Skip to content

Commit 6e1475e

Browse files
Copilotgreglucas
andcommitted
Fix error test cases to match actual exception types
Co-authored-by: greglucas <12417828+greglucas@users.noreply.github.com>
1 parent acc4911 commit 6e1475e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tests/unit/test_xtce/test_comparisons.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,15 +394,15 @@ def test_condition_validity_check(args, kwargs, expected_error, expected_error_m
394394
),
395395
True,
396396
),
397-
# Error case: invalid comparison value
397+
# Error case: invalid XML structure (missing ComparisonOperator)
398398
(
399399
f"""
400400
<xtce:BooleanExpression xmlns:xtce="{XTCE_1_2_XMLNS}">
401401
<xtce:Condition parameterRef="P" value="invalid" />
402402
</xtce:BooleanExpression>
403403
""",
404404
SpacePacket(**{"P": common.IntParameter(100, 4)}),
405-
ValueError("invalid literal for int()"),
405+
AttributeError("'NoneType' object has no attribute 'text'"),
406406
),
407407
],
408408
)

tests/unit/test_xtce/test_parameter_types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ def test_float_parameter_type(elmaker, xtce_parser, xml_string: str, expectation
463463
</xtce:EnumerationList>
464464
</xtce:EnumeratedParameterType>
465465
""",
466-
ValueError("Parameter Type name attribute is required"),
466+
KeyError("name"),
467467
),
468468
],
469469
)
@@ -810,7 +810,7 @@ def test_boolean_parameter_type(elmaker, xtce_parser, xml_string, expectation):
810810
</xtce:Encoding>
811811
</xtce:AbsoluteTimeParameterType>
812812
""",
813-
ValueError("Parameter Type name attribute is required"),
813+
KeyError("name"),
814814
),
815815
],
816816
)

0 commit comments

Comments
 (0)