From 7d03370e6f8951a224051b8252ea0c2876fe3be5 Mon Sep 17 00:00:00 2001 From: mraniki <8766259+mraniki@users.noreply.github.com> Date: Sun, 7 Jul 2024 07:18:02 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20Unit=20Test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_unit.py | 2 +- tests/test_unit_exception | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/test_unit.py b/tests/test_unit.py index 1006e95..900d874 100644 --- a/tests/test_unit.py +++ b/tests/test_unit.py @@ -157,7 +157,7 @@ async def test_standard_get_order(fmo, order, result_order): async def test_create_client_exception(fmo, caplog): - result = fmo.create_client(parser_library="none") + result = fmo.create_client() assert result is not None assert any( record.message diff --git a/tests/test_unit_exception b/tests/test_unit_exception index a634ccd..dd68b02 100644 --- a/tests/test_unit_exception +++ b/tests/test_unit_exception @@ -19,7 +19,7 @@ def fmo(): return FindMyOrder() -async def test_create_client_exception(fmo, caplog): +async def test_module_exception(fmo, caplog): result = fmo.create_client(parser_library="none") assert result is not None assert any( @@ -29,3 +29,13 @@ async def test_create_client_exception(fmo, caplog): ) +async def test_create_client_exception(fmo, caplog): + fmo.enabled = True + result = fmo.create_client() + assert result is not None + assert any( + record.message + == "No Client were created. Check your settings or disable the module." + for record in caplog.records + if record.levelname == "WARNING" + )