Commit 92323b9c authored by Duncan Macleod's avatar Duncan Macleod

more bug fixes

parent e31a0e89
Pipeline #60380 passed with stages
in 2 minutes and 24 seconds
......@@ -154,7 +154,6 @@ def _find_urls(ext, site, tag, start, end, urltype=None, match=None,
search = segment(start, end)
lfns = defaultdict(list)
maxgps = -1e9 # something absurdly old
print("TEST")
for (path, cdur), seglist in current_app.get_cache_data(
ext,
site,
......@@ -162,7 +161,6 @@ def _find_urls(ext, site, tag, start, end, urltype=None, match=None,
).items():
# if running a 'latest' URL search, restrict the search to
# the most recent available segment for this frametype
print(path, cdur, seglist, search)
if latest and seglist: # 'if seglist' to prevent IndexError
latest = _get_latest_segment(seglist, cdur)
if latest[1] <= maxgps: # if this is not an improvement, move on
......@@ -193,8 +191,6 @@ def _find_urls(ext, site, tag, start, end, urltype=None, match=None,
_gsiftp_url(path),
))
print(allurls)
# filter URLs for each LFN and return
urls = []
for lfn in allurls:
......
......@@ -74,10 +74,10 @@ def test_find_urls(client):
"/LDR/services/data/v1/gwf/L/L1_TEST_1/1000000004,1000000016.json",
)
assert resp.status_code == 200
assert resp.json == [
assert sorted(resp.json) == [
"file://localhost/test/path/L-L1_TEST_1-1000000004-4.gwf",
"gsiftp://testhost:15000/test/path/L-L1_TEST_1-1000000004-4.gwf",
"file://localhost/test/path/L-L1_TEST_1-1000000012-4.gwf",
"gsiftp://testhost:15000/test/path/L-L1_TEST_1-1000000004-4.gwf",
"gsiftp://testhost:15000/test/path/L-L1_TEST_1-1000000012-4.gwf",
]
......@@ -88,7 +88,7 @@ def test_find_urls_urltype(client):
"/gwf/L/L1_TEST_1/1000000004,1000000016/file.json",
)
assert resp.status_code == 200
assert resp.json == [
assert sorted(resp.json) == [
"file://localhost/test/path/L-L1_TEST_1-1000000004-4.gwf",
"file://localhost/test/path/L-L1_TEST_1-1000000012-4.gwf",
]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment