|
|
@ -10,6 +10,7 @@ def test_setup(live_server):
|
|
|
|
# Hard to just add more live server URLs when one test is already running (I think)
|
|
|
|
# Hard to just add more live server URLs when one test is already running (I think)
|
|
|
|
# So we add our test here (was in a different file)
|
|
|
|
# So we add our test here (was in a different file)
|
|
|
|
def test_headers_in_request(client, live_server):
|
|
|
|
def test_headers_in_request(client, live_server):
|
|
|
|
|
|
|
|
|
|
|
|
#ve_server_setup(live_server)
|
|
|
|
#ve_server_setup(live_server)
|
|
|
|
# Add our URL to the import page
|
|
|
|
# Add our URL to the import page
|
|
|
|
test_url = url_for('test_headers', _external=True)
|
|
|
|
test_url = url_for('test_headers', _external=True)
|
|
|
@ -378,13 +379,17 @@ def test_headers_textfile_in_request(client, live_server):
|
|
|
|
with open('test-datastore/' + extract_UUID_from_client(client) + '/headers.txt', 'w') as f:
|
|
|
|
with open('test-datastore/' + extract_UUID_from_client(client) + '/headers.txt', 'w') as f:
|
|
|
|
f.write("watch-header: nice")
|
|
|
|
f.write("watch-header: nice")
|
|
|
|
|
|
|
|
|
|
|
|
# seems to weird when run on github
|
|
|
|
wait_for_all_checks(client)
|
|
|
|
time.sleep(2)
|
|
|
|
|
|
|
|
client.get(url_for("form_watch_checknow"), follow_redirects=True)
|
|
|
|
client.get(url_for("form_watch_checknow"), follow_redirects=True)
|
|
|
|
|
|
|
|
|
|
|
|
# Give the thread time to pick it up
|
|
|
|
# Give the thread time to pick it up, this actually is not super reliable and pytest can terminate before the check is ran
|
|
|
|
wait_for_all_checks(client)
|
|
|
|
wait_for_all_checks(client)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# WARNING - pytest and 'wait_for_all_checks' shuts down before it has actually stopped processing when using pyppeteer fetcher
|
|
|
|
|
|
|
|
# so adding more time here
|
|
|
|
|
|
|
|
if os.getenv('FAST_PUPPETEER_CHROME_FETCHER'):
|
|
|
|
|
|
|
|
time.sleep(6)
|
|
|
|
|
|
|
|
|
|
|
|
res = client.get(url_for("edit_page", uuid="first"))
|
|
|
|
res = client.get(url_for("edit_page", uuid="first"))
|
|
|
|
assert b"Extra headers file found and will be added to this watch" in res.data
|
|
|
|
assert b"Extra headers file found and will be added to this watch" in res.data
|
|
|
|
|
|
|
|
|
|
|
|