Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
CindyvdVries committed May 22, 2024
1 parent 2990d75 commit 6e558c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions decoimpact/data/parsers/parser_classification_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,14 @@ def divide_table_in_unique_chunks(criteria_table, conditions={}, unique=True):
divide_table_in_unique_chunks(new_crit_table, {}, unique)
del new_crit_table[key]

if len(msgs) < 2:
max_msg = 6
if len(msgs) < max_msg:
logger.log_warning("\n".join(msgs))
else:
logger.log_warning("\n".join(msgs[:10]))
logger.log_warning("\n".join(msgs[:max_msg]))
logger.log_warning(
f"{len(msgs)} warnings found concerning coverage of the "
"parameters. Only first 10 warnings are shown. See "
f"parameters. Only first {max_msg} warnings are shown. See "
"classification_warnings.log file for all warnings."
)
f = open("classification_warnings.log", "w")
Expand Down
2 changes: 1 addition & 1 deletion tests/data/parsers/test_parser_classification_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,6 @@ def test_feedback_for_criteria_multiple_parameters_more_10_warnings():
data.parse_dict(contents, logger)

logger.log_warning.assert_called_with(
"11 warnings found concerning coverage of the parameters. Only first 10 "
"11 warnings found concerning coverage of the parameters. Only first 6 "
"warnings are shown. See classification_warnings.log file for all warnings."
)

0 comments on commit 6e558c0

Please sign in to comment.