Skip to content

Commit

Permalink
Make summary as optional when register checkers and checker bundles (#32
Browse files Browse the repository at this point in the history
)

Signed-off-by: hoangtungdinh <[email protected]>
  • Loading branch information
hoangtungdinh authored Sep 10, 2024
1 parent 34d6e57 commit ad77fc6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
10 changes: 7 additions & 3 deletions qc_baselib/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class Result:
build_date="2024-05-31",
description="Example checker bundle",
version="0.0.1",
summary="Tested example checkers",
)
result.write_to_file("testResults.xqar")
Expand Down Expand Up @@ -226,7 +225,12 @@ def _get_issue(
return issue

def register_checker_bundle(
self, build_date: str, description: str, name: str, version: str, summary: str
self,
build_date: str,
description: str,
name: str,
version: str,
summary: str = "",
) -> None:
bundle = result.CheckerBundleType(
build_date=build_date,
Expand All @@ -246,7 +250,7 @@ def register_checker(
checker_bundle_name: str,
checker_id: str,
description: str,
summary: str,
summary: str = "",
) -> None:

checker = result.CheckerType(
Expand Down
19 changes: 19 additions & 0 deletions tests/test_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,3 +728,22 @@ def test_has_at_least_one_issue_from_rules() -> None:
)

assert result_report.has_at_least_one_issue_from_rules({}) == False


def test_registration_without_summary() -> None:
result_report = Result()

result_report.register_checker_bundle(
name="TestBundle",
build_date="2024-05-31",
description="Example checker bundle",
version="0.0.1",
)

result_report.register_checker(
checker_bundle_name="TestBundle",
checker_id="TestChecker",
description="Test checker",
)

assert True

0 comments on commit ad77fc6

Please sign in to comment.