Skip to content

Commit

Permalink
Fix test to be stable independent of OS
Browse files Browse the repository at this point in the history
Signed-off-by: patrickpa <[email protected]>
  • Loading branch information
patrickpa committed Jun 11, 2024
1 parent 48d2314 commit 71433c8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
2 changes: 0 additions & 2 deletions tests/data/demo_checker_bundle_extended.xqar
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
<Checker checkerId="exampleIssueRuleChecker" description="This is a description of checker with issue and the involved ruleUID" status="completed" summary="">
<AddressedRule ruleUID="test.com:qc:1.0.0:qwerty.qwerty"/>
<Issue description="This is an information from the demo usecase" issueId="2" level="1" ruleUID="test.com:qc:1.0.0:qwerty.qwerty">

<Locations description="inertial position">
<InertialLocation x="1.000000" y="2.000000" z="3.000000"/>
</Locations>
Expand All @@ -37,7 +36,6 @@
</InternalElementNested>
</TestTagFor>
</DomainSpecificInfo>

</Issue>
</Checker>
<Checker checkerId="exampleSkippedChecker" description="This is a description of checker with skipped status" status="skipped" summary="Skipped execution"/>
Expand Down
16 changes: 5 additions & 11 deletions tests/test_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,20 +358,14 @@ def test_set_checker_status_skipped_with_issues() -> None:


def test_domain_specific_load(loaded_extended_result: Result):
xml_text = (
loaded_extended_result._report_results.checker_bundles[0]
.checkers[3]
.issues[0]
.to_xml(
pretty_print=True,
)
issue = (
loaded_extended_result._report_results.checker_bundles[0].checkers[3].issues[0]
)

# Evaluate if loading of issues with domain elements is properly done
assert (
xml_text
== b'<Issue issueId="2" description="This is an information from the demo usecase" level="1" ruleUID="test.com:qc:1.0.0:qwerty.qwerty"><Locations description="inertial position"><InertialLocation x="1.0" y="2.0" z="3.0"/></Locations><DomainSpecificInfo name="test_domain">\n <RoadLocation b="5.4" c="0.0" id="aa"/>\n <RoadLocation b="5.4" c="0.0" id="aa"/>\n <TestTagFor>\n <InternalElementA a="1.0"/>\n <InternalElementA a="1.0"/>\n <InternalElementNested a="1.0">\n <NestedElement/>\n </InternalElementNested>\n </TestTagFor>\n </DomainSpecificInfo>\n \n </Issue>\n'
)
assert len(issue.locations) == 1
assert len(issue.domain_specific_info_raw) > 0
assert type(issue.domain_specific_info_raw) == etree._Element


def test_domain_specific_info_add():
Expand Down

0 comments on commit 71433c8

Please sign in to comment.