Skip to content

Commit 8d9e215

Browse files
authored
JP-2928: Update regression tests to use flight data - set_telescope_pointing.add_wcs edition (#8887)
1 parent 657c132 commit 8d9e215

File tree

86 files changed

+179
-1358
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+179
-1358
lines changed

jwst/engdblog/engdblog.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from ..lib.engdb_tools import ENGDB_Service
2+
from ..lib.engdb_mast import EngdbMast
23
from ..stpipe import Step
34

45

@@ -21,10 +22,10 @@ class EngDBLogStep(Step):
2122
"""
2223

2324
spec = """
24-
stime = string(default='2021-01-25') # Start time
25-
etime = string(default='2021-01-27') # End time
25+
stime = string(default='2022-01-25 02:00:00') # Start time
26+
etime = string(default='2022-01-26 02:10:00') # End time
2627
verbosity = option('initial', 'all', default='initial') # How much to report.
27-
engdb_url = string(default='http://localhost') # Mock url
28+
engdb_url = string(default=None) # Mock url
2829
"""
2930

3031
def process(self, mnemonics):
@@ -46,7 +47,10 @@ def process(self, mnemonics):
4647
stime = self.stime
4748
etime = self.etime
4849
verbosity = self.verbosity
49-
edb = ENGDB_Service(base_url=self.engdb_url)
50+
if self.engdb_url is not None:
51+
edb = ENGDB_Service(base_url=self.engdb_url)
52+
else:
53+
edb = EngdbMast()
5054

5155
if isinstance(mnemonics, str):
5256
mnemonics = [mnemonics]

jwst/engdblog/tests/test_engdblog.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
import os
55
import pytest
66
from tempfile import TemporaryDirectory
7-
7+
from jwst.lib import engdb_mast
88
from jwst.engdblog import EngDBLogStep
9-
from jwst.lib.tests.engdb_mock import EngDB_Mocker
109

1110

1211
def test_engdblogstep(caplog, engdb):
@@ -17,7 +16,7 @@ def test_engdblogstep(caplog, engdb):
1716
assert 'EngDBLogStep instance created' in caplog.text
1817
assert mnemonic in caplog.text
1918
assert "Step EngDBLogStep running with args (['{}'],)".format(mnemonic) in caplog.text
20-
assert '{}[2021-01-25:2021-01-27] = '.format(mnemonic) in caplog.text
19+
assert '{}[2022-01-25 02:00:00:2022-01-26 02:10:00] = '.format(mnemonic) in caplog.text
2120
assert 'Step EngDBLogStep done' in caplog.text
2221

2322

@@ -29,7 +28,7 @@ def test_barestring(caplog, engdb):
2928
assert 'EngDBLogStep instance created' in caplog.text
3029
assert mnemonic in caplog.text
3130
assert f"Step EngDBLogStep running with args ('{mnemonic}',)." in caplog.text
32-
assert '{}[2021-01-25:2021-01-27] = '.format(mnemonic) in caplog.text
31+
assert '{}[2022-01-25 02:00:00:2022-01-26 02:10:00] = '.format(mnemonic) in caplog.text
3332
assert 'Step EngDBLogStep done' in caplog.text
3433

3534

@@ -38,7 +37,7 @@ def test_badmnemonic(caplog, engdb):
3837
result = EngDBLogStep.call([mnemonic])
3938
assert isinstance(result, dict)
4039
assert len(result) == 0
41-
assert 'Cannot retrieve info for {}'.format(mnemonic) in caplog.text
40+
assert '{} has no entries in time range'.format(mnemonic) in caplog.text
4241

4342

4443
def test_novalues(caplog, engdb):
@@ -65,13 +64,12 @@ def test_multi_mnemonics(caplog, engdb):
6564
result = EngDBLogStep.call(mnemonics)
6665
assert len(result) == 2
6766
for mnemonic in mnemonics:
68-
assert '{}[2021-01-25:2021-01-27] = '.format(mnemonic) in caplog.text
67+
assert '{}[2022-01-25 02:00:00:2022-01-26 02:10:00] = '.format(mnemonic) in caplog.text
6968

7069

7170
# #####################
7271
# Utilities for testing
7372
# #####################
7473
@pytest.fixture
7574
def engdb():
76-
with EngDB_Mocker() as mocker: # noqa: F841
77-
yield
75+
yield engdb_mast.EngdbMast()

jwst/lib/engdb_mast.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,6 @@ def configure(self, base_url=None, token=None):
187187
# Get the token
188188
if token is None:
189189
token = getenv('MAST_API_TOKEN', None)
190-
if token is None:
191-
raise RuntimeError('No MAST token provided but is required. See https://auth.mast.stsci.edu/ for more information.')
192190
self.token = token
193191

194192
# Get various timeout parameters

jwst/lib/tests/data/add_wcs_default.fits

Lines changed: 19 additions & 16 deletions
Large diffs are not rendered by default.

jwst/lib/tests/data/add_wcs_method_full_nosiafdb.fits

Lines changed: 19 additions & 16 deletions
Large diffs are not rendered by default.

jwst/lib/tests/data/add_wcs_with_db.fits

Lines changed: 18 additions & 16 deletions
Large diffs are not rendered by default.

jwst/lib/tests/data/engdb/inrsi_gwa_y_tilt_avged_data.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

jwst/lib/tests/data/engdb/meta.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

jwst/lib/tests/data/engdb/sa_zaducmdx_data.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

jwst/lib/tests/data/engdb/sa_zaducmdy_data.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)