Skip to content

Commit

Permalink
Add --strict argument. Only used for rodeo profile for now.
Browse files Browse the repository at this point in the history
  • Loading branch information
ways committed Nov 22, 2024
1 parent f3be44e commit 68e44a5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
11 changes: 6 additions & 5 deletions sedr/schemat.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,12 @@ def test_edr_collections(case):
) from err

if use_rodeoprofile:
requirement7_3, requirement7_3_message = rodeoprofile.requirement7_3(
jsondata=collection
)
if not requirement7_3:
raise AssertionError(requirement7_3_message)
if util.args.strict:
requirement7_3, requirement7_3_message = rodeoprofile.requirement7_3(
jsondata=collection
)
if not requirement7_3:
raise AssertionError(requirement7_3_message)

requirement7_4, requirement7_4_message = rodeoprofile.requirement7_4(
jsondata=collection
Expand Down
6 changes: 6 additions & 0 deletions sedr/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ def parse_args(args, version: str = "") -> argparse.Namespace:
default=False,
help="Use the rodeo profile even though the API doesn't specify it. Default False.",
)
parser.add_argument(
"--strict",
action="store_true",
default=False,
help="Treat SHOULD in any profile as SHALL. Default False.",
)

args = parser.parse_args(args)
# Parse out base_path for convenience
Expand Down

0 comments on commit 68e44a5

Please sign in to comment.