From aab598c2f54b0beb3373400250ad8babff13149a Mon Sep 17 00:00:00 2001 From: Sajith Sasidharan Date: Fri, 17 Jul 2020 14:30:17 -0400 Subject: [PATCH] Update integration test for status page As a fallout of transition from nevow to twisted web, list of hrefs in the parsed status page will be [u'/status/down-0', u'/status/up-0', u'/'] (with an added '/status/' prefix) so we need to update our assumptions. See 5c886b1b2 for the change that necessitated this. --- integration/test_web.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/integration/test_web.py b/integration/test_web.py index 4ba0a6fd1..575e4fc1a 100644 --- a/integration/test_web.py +++ b/integration/test_web.py @@ -219,23 +219,21 @@ def test_status(alice): found_upload = False found_download = False for href in hrefs: - if href.startswith(u"/") or not href: + if href == u"/" or not href: continue - resp = requests.get( - util.node_url(alice.node_dir, u"status/{}".format(href)), - ) - if href.startswith(u'up'): + resp = requests.get(util.node_url(alice.node_dir, href)) + if href.startswith(u"/status/up"): assert "File Upload Status" in resp.content if "Total Size: {}".format(len(FILE_CONTENTS)) in resp.content: found_upload = True - elif href.startswith(u'down'): + elif href.startswith(u"/status/down"): assert "File Download Status" in resp.content if "Total Size: {}".format(len(FILE_CONTENTS)) in resp.content: found_download = True # download the specialized event information resp = requests.get( - util.node_url(alice.node_dir, u"status/{}/event_json".format(href)), + util.node_url(alice.node_dir, u"{}/event_json".format(href)), ) js = json.loads(resp.content) # there's usually just one "read" operation, but this can handle many ..