From: Alexander Popov Date: Mon, 10 Jun 2024 13:12:15 +0000 (+0300) Subject: Code refactoring to improve test coverage (I) X-Git-Tag: v0.6.10~56 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=ae11f047cf2ccff17e898e26009dad7430373e0a;p=kconfig-hardened-check.git Code refactoring to improve test coverage (I) --- diff --git a/kernel_hardening_checker/__init__.py b/kernel_hardening_checker/__init__.py index 5893fab..043dae8 100644 --- a/kernel_hardening_checker/__init__.py +++ b/kernel_hardening_checker/__init__.py @@ -116,12 +116,12 @@ def print_checklist(mode: StrOrNone, checklist: List[ChecklistObjType], with_res ok_count += 1 if mode == 'show_fail': continue - elif opt.result.startswith('FAIL'): + else: + assert(opt.result.startswith('FAIL')), \ + f'unexpected result "{opt.result}" of {opt.name} check' fail_count += 1 if mode == 'show_ok': continue - else: - assert(False), f'unexpected result "{opt.result}" of {opt.name} check' opt.table_print(mode, with_results) print() if mode == 'verbose':