Skip to content

Commit

Permalink
Update test_assync.py to properly read status
Browse files Browse the repository at this point in the history
  • Loading branch information
gschwind committed Nov 7, 2023
1 parent 89762e9 commit fb1d4a2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tests/test_assync.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
from pywps.tests import client_for, assert_response_accepted, assert_response_success
from processes import Sleep
from owslib.wps import WPSExecution
from pathlib import Path
from tempfile import TemporaryDirectory
from pywps import dblog
from urllib.parse import urlparse

VERSION = "1.0.0"

Expand Down Expand Up @@ -50,13 +48,13 @@ def test_async(self):
print(url)

# OWSlib only reads from URLs, not local files. So we need to read the response manually.
p = Path(configuration.get_config_value('server', 'outputpath')) / url.split('/')[-1]
url = urlparse(url)

# Poll the process until it completes
total_time = 0
sleep_time = .01
while wps.status not in ["ProcessSucceeded", "ProcessFailed"]:
resp = p.read_bytes()
resp = client.get(f'{url.path}?{url.query}').data
if resp:
wps.checkStatus(response=resp, sleepSecs=0.01)
else:
Expand Down

0 comments on commit fb1d4a2

Please sign in to comment.