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 Sep 15, 2023
1 parent d1b94c3 commit 51019df
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_assync.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +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 urllib.parse import urlparse

VERSION = "1.0.0"

Expand Down Expand Up @@ -49,13 +49,13 @@ def test_async(self):
url = resp.xml.xpath("//@statusLocation")[0]

# OWSlib only reads from URLs, not local files. So we need to read the response manually.
p = Path(url[6:])
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 51019df

Please sign in to comment.