Skip to content
Snippets Groups Projects
Verified Commit 4b73d0de authored by Timm Fitschen's avatar Timm Fitschen
Browse files

TST: add tests for filesystem resource behind proxies

parent 23922244
No related branches found
No related tags found
1 merge request!64TST: filestem response url
Pipeline #39675 passed
...@@ -60,6 +60,27 @@ def test_file_system_returns_ids(clear_database): ...@@ -60,6 +60,27 @@ def test_file_system_returns_ids(clear_database):
assert search in str(body) assert search in str(body)
def test_file_system_returns_correct_url_with_proxy(clear_database):
c = db.get_connection()
resp = c.retrieve(
entity_uri_segments=["FileSystem"],
headers={"X-Forwarded-Proto": "myscheme"},
reconnect=True)
body = resp.read()
print(body)
search = 'url="myscheme://'
assert search in str(body)
resp = c.retrieve(
entity_uri_segments=["FileSystem"],
headers={"Forwarded": "by=byid;for=forid;host=hostaddress;proto=myother"},
reconnect=True)
body = resp.read()
print(body)
search = 'url="myother://'
assert search in str(body)
def test_sat_query_with_leading_slash(clear_database): def test_sat_query_with_leading_slash(clear_database):
upload_file = open("test.dat", "w") upload_file = open("test.dat", "w")
upload_file.write("hello world\n") upload_file.write("hello world\n")
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment