Skip to content

Commit 0abbde3

Browse files
authored
Add ADaM product standards to StandardTypes CLI gate (#1770)
StandardTypes is the allow-list core.py uses to validate -s/--standard. It lists adamig but not the other six ADaM products in ADAM_PRODUCTS (adam-adae, adam-md, adam-nca, adam-occds, adam-tte, adam-poppk), which are already handled by normalize_standard_input(). As a result a command such as `-s adam-tte` is rejected before the engine runs, even though the engine supports it. Add the six products to StandardTypes, completing the normalization from #1733 (which added adamig and the sendig-* products), and add a test asserting the gate stays in sync with ADAM_PRODUCTS. Signed-off-by: Antony Bevan <antonymichealbevan04@gmail.com>
1 parent 25c64ae commit 0abbde3

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

cdisc_rules_engine/enums/standard_types.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,11 @@ class StandardTypes(BaseEnum):
1010
SENDIG_DART = "sendig-dart"
1111
SENDIG_GENETOX = "sendig-genetox"
1212
ADAMIG = "adamig"
13+
ADAM_ADAE = "adam-adae"
14+
ADAM_MD = "adam-md"
15+
ADAM_NCA = "adam-nca"
16+
ADAM_OCCDS = "adam-occds"
17+
ADAM_TTE = "adam-tte"
18+
ADAM_POPPK = "adam-poppk"
1319
TIG = "tig"
1420
USDM = "usdm"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from cdisc_rules_engine.constants.adam_products import ADAM_PRODUCTS
2+
from cdisc_rules_engine.enums.standard_types import StandardTypes
3+
4+
5+
def test_standard_types_includes_all_adam_products():
6+
"""Every ADaM product handled by normalize_standard_input must be a valid
7+
CLI standard. If it is not, ``-s <product>`` is rejected by the standards
8+
gate in core.py before the engine runs.
9+
"""
10+
supported = set(StandardTypes.values())
11+
missing = [p for p in ADAM_PRODUCTS if p not in supported]
12+
assert not missing, f"ADAM products absent from StandardTypes: {missing}"

0 commit comments

Comments
 (0)