From cbe47ab6748f3585c9e208ec74228d0e69d6689b Mon Sep 17 00:00:00 2001 From: Maximilien Rigaut Date: Mon, 16 May 2022 03:26:01 +0200 Subject: [PATCH] Raised Coverage to 94% --- tests/modules/test_context_mngr.py | 2 +- tests/modules/test_error_mngr.py | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/tests/modules/test_context_mngr.py b/tests/modules/test_context_mngr.py index 5c39233..a790f74 100644 --- a/tests/modules/test_context_mngr.py +++ b/tests/modules/test_context_mngr.py @@ -51,4 +51,4 @@ def test_base_container_with_optionals(): i, c = OI(), CI() base.optionals = [i, c] assert base.fetch_html_insert() == [i] - assert base.fetch_class_insert() == [c] \ No newline at end of file + assert base.fetch_class_insert() == [c] diff --git a/tests/modules/test_error_mngr.py b/tests/modules/test_error_mngr.py index 4a2c8c0..2b64780 100644 --- a/tests/modules/test_error_mngr.py +++ b/tests/modules/test_error_mngr.py @@ -78,5 +78,22 @@ def re_import_log(): reload(logging) +def test_dict_check(): + """ + Test the dict_check function + """ + assert(error_mngr.dict_check({"test": "test"}, "test") == [True]) + assert(error_mngr.dict_check({"test": "test"}, "test2") == [False]) + assert(error_mngr.dict_check({"test": {"test3": "test5"}}, "test", "test3") == [True, True]) + assert(error_mngr.dict_check({"test": {"test3": "test5"}}, "test4", "test4") == [False, False]) + assert(error_mngr.dict_check({"test": {"test3": "test5"}}, "test", "test34") == [True, False]) + + +# @pytest.mark.xfail(strict=True, reason="This test is not implemented yet") +def test_dict_check_2(): + assert(error_mngr.dict_check({"test": "test"}, "test", "test2") == [True, False]) + assert(error_mngr.dict_check({"test": "test"}, "test", "test2", "test3") == [True, False, False]) + + if __name__ == '__main__': TestLogging().test_init_logging()