Skip to content
Snippets Groups Projects
Commit 5d197789 authored by Duncan Macleod's avatar Duncan Macleod Committed by Duncan Macleod
Browse files

tests: add regression test for #20

parent 120cbb79
No related branches found
No related tags found
1 merge request!61Support arbitrary float or int in URLs
......@@ -132,6 +132,29 @@ def test_find_urls_filter_preference(client):
]
@mock.patch.object(api_utils, "_DEFAULT_GSIFTP_HOST", new="testhost")
@pytest.mark.parametrize(("start", "end"), [
(1000000003.5, 1000000012.5),
(1000000003, 1000000012.5),
(1000000003.5, 1000000013),
])
def test_find_urls_noninteger(client, start, end):
"""Test the `find_urls` view with non-integer GPS times.
"""
resp = client.get(
f"/services/data/v1/gwf/L/L1_TEST_1/{start},{end}.json",
)
assert resp.status_code == 200
assert sorted(resp.json) == [
"file://localhost/test/path/L-L1_TEST_1-1000000000-4.gwf",
"file://localhost/test/path/L-L1_TEST_1-1000000004-4.gwf",
"file://localhost/test/path2/L-L1_TEST_1-1000000012-4.gwf",
"gsiftp://testhost:15000/test/path/L-L1_TEST_1-1000000000-4.gwf",
"gsiftp://testhost:15000/test/path/L-L1_TEST_1-1000000004-4.gwf",
"gsiftp://testhost:15000/test/path2/L-L1_TEST_1-1000000012-4.gwf",
]
@mock.patch.object(api_utils, "_DEFAULT_GSIFTP_HOST", new="testhost")
def test_find_latest(client):
"""Test the `find_latest` view
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment