Tweaking test for global headers.txt

1448-basic-headers-fetch-from-file
dgtlmoon 1 year ago
parent 04429b88ee
commit 284d0a0246

@ -14,12 +14,14 @@ global app
def cleanup(datastore_path):
# Unlink test output files
files = ['output.txt',
'url-watches.json',
'secret.txt',
'notification.txt',
files = [
'count.txt',
'endpoint-content.txt'
'headers.txt',
'notification.txt',
'secret.txt',
'url-watches.json',
'output.txt',
]
for file in files:
try:

@ -1,4 +1,5 @@
import json
import os
import time
from flask import url_for
from . util import set_original_response, set_modified_response, live_server_setup, wait_for_all_checks
@ -238,6 +239,7 @@ def test_method_in_request(client, live_server):
assert b'Deleted' in res.data
def test_headers_textfile_in_request(client, live_server):
# Add our URL to the import page
test_url = url_for('test_headers', _external=True)
@ -286,9 +288,11 @@ def test_headers_textfile_in_request(client, live_server):
url_for("preview_page", uuid="first"),
follow_redirects=True
)
assert b"global-header: nice" in res.data
assert b"next-global-header: nice" in res.data
assert b"cool: yeah" in res.data
assert b"Global-Header:nice" in res.data
assert b"Next-Global-Header:nice" in res.data
assert b"Xxx:ooo" in res.data
os.unlink('test-datastore/headers.txt')
#unlink headers.txt on start/stop
res = client.get(url_for("form_delete", uuid="all"), follow_redirects=True)

Loading…
Cancel
Save