Incorrect p_astro data filenames in mock_url test_tasks_p_astro_gstlal.py
In test_tasks_p_astro_gstlal.py
, the mock_url
fixture is defined like this:
class MockResponseWeights(object):
def __init__(self):
self.url = "data/H1L1V1-weights-bins_686-1126051217-61603201.json"
def read(self):
with pkg_resources.resource_stream(__name__, self.url) as f:
return f.read()
def close(self):
pass
@pytest.fixture
def mock_url(monkeypatch):
def _urlfunc(url):
filename = "data/H1L1V1-weights-bins_686-1126051217-61603201.json"
if url == app.conf['p_astro_url']:
with pkg_resources.resource_stream(__name__, filename) as f:
return f
elif url == app.conf['p_astro_weights_url']:
return MockResponseWeights()
monkeypatch.setattr('urllib.request.urlopen', _urlfunc)
The data file data/H1L1V1-weights-bins_686-1126051217-61603201.json
is used for both p_astro_url
and p_astro_weights_url
, whereas the former should have been H1L1V1-mean_counts-1126051217-61603201.json
.
The try
/except
blocks that handle missing keys probably masked this error. Resolving this may uncover other issues.