Skip to content
Snippets Groups Projects
Commit 120cbb79 authored by Duncan Meacher's avatar Duncan Meacher
Browse files

Merge branch 'fix-find_url' into 'master'

Fix bug in find_url

Closes #22

See merge request !60
parents babbb392 19332dde
No related branches found
No related tags found
1 merge request!60Fix bug in find_url
Pipeline #521026 passed with warnings
......@@ -199,14 +199,16 @@ def find_url(ext, site, tag, filename):
"""
# parse GPS information from filename
_, _, start, dur = filename.split('-')
dur = dur[:-len(ext)].rstrip('.')
dur = float(dur[:-len(ext)].rstrip('.'))
start = float(start)
end = start + dur
# find urls
return list(_find_urls(
ext,
site,
tag,
int(start),
int(start + dur),
start,
end,
))
......
......@@ -81,12 +81,12 @@ def test_find_url(client):
"""
resp = client.get(
"/services/data/v1"
"/h5/L/L1_TEST_1/L-L1_TEST_1-1000000004-4.h5.json",
"/h5/L/L1_TEST_1/L-L1_TEST_1-1000000000-4.h5.json",
)
assert resp.status_code == 200
assert resp.json == [
"file://localhost/test/path/L-L1_TEST_1-1000000004-4.h5",
"gsiftp://testhost:15000/test/path/L-L1_TEST_1-1000000004-4.h5",
"file://localhost/test/path/L-L1_TEST_1-1000000000-4.h5",
"gsiftp://testhost:15000/test/path/L-L1_TEST_1-1000000000-4.h5",
]
......
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