Skip to content

Commit

Permalink
tests/roman-metrics-logger-decorators (#943)
Browse files Browse the repository at this point in the history
* added metrics logger DMS tags to relevant Roman tests

* update changelog

* added metrics-logger to test deps
  • Loading branch information
alphasentaurii authored Aug 17, 2023
1 parent 08da107 commit 0c01270
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
8 changes: 8 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
11.17.3 (unreleased)
====================

ROMAN
-----

- Added metrics-logger decorators with DMS tags to appropriate Roman tests [#943]

11.17.2 (2023-06-29)
====================

Expand Down
9 changes: 6 additions & 3 deletions crds/tests/test_roman.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from crds.tests import test_config
from nose.tools import raises

from metrics_logger.decorators import metrics_logger

class TestRoman(unittest.TestCase):
""" TestRoman is a collection of crds unit tests for ROMAN.
Expand All @@ -23,6 +23,7 @@ def setUp(self):
def tearDown(self):
test_config.cleanup(self.old_state)

@metrics_logger("DMS16", "DMS25")
def test_getreferences_with_valid_header_ISOT_fmt(self):
""" test_getreferences_with_valid_header: test satisfies Roman 303.1 and 628.1
"""
Expand All @@ -39,7 +40,8 @@ def test_getreferences_with_valid_header_ISOT_fmt(self):
)

assert pathlib.Path(result["dark"]).name == "roman_wfi_dark_0001.asdf"


@metrics_logger("DMS16", "DMS25", "DMS26")
def test_getreferences_with_valid_header_ISO_fmt(self):
""" test_getreferences_with_valid_header: test satisfies Roman 303.1 and 628.1
"""
Expand Down Expand Up @@ -86,7 +88,7 @@ def test_getreferences_with_valid_header_ISO_fmt(self):

assert pathlib.Path(result["distortion"]).name == "roman_wfi_distortion_0001.asdf"


@metrics_logger("DMS16")
@raises(CrdsLookupError)
def test_getreferences_with_invalid_header(self):
""" test_getreferences_with_invalid_header: test satisfies Roman 303.1
Expand All @@ -103,6 +105,7 @@ def test_getreferences_with_invalid_header(self):
reftypes=["dark"]
)

@metrics_logger("DMS114", "DMS25", "DMS26")
def test_list_references(self):
""" test_list_references: test satisfies Roman 303.2 and 628.2
"""
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ test = [
"flake8",
"bandit",
"coverage",
"metrics-logger",
]
docs = [
"sphinx",
Expand Down

0 comments on commit 0c01270

Please sign in to comment.