Skip to content

Commit

Permalink
✅ Unit Test
Browse files Browse the repository at this point in the history
  • Loading branch information
mraniki committed Jul 6, 2024
1 parent d38285d commit c2a068b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions findmyorder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def __init__(
self.enabled = settings.findmyorder_enabled
if not self.enabled:
logger.info("FindMyOrder is disabled. No Parser will be created.")
return
self.client_classes = self.get_all_client_classes()
self.clients = []
# Create a client for each client in settings
Expand Down
7 changes: 6 additions & 1 deletion tests/test_unit_exception
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,9 @@ def fmo():
async def test_create_client_exception(fmo, caplog):
result = fmo.create_client(parser_library="none")
assert result is not None
assert "No Client were created" in caplog.text
assert any(
record.message
== "No Client were created. Check your settings or disable the module."
for record in caplog.records
if record.levelname == "WARNING"
)

0 comments on commit c2a068b

Please sign in to comment.