Skip to content

Commit

Permalink
test(status_endpoint): mock task.status
Browse files Browse the repository at this point in the history
  • Loading branch information
ElJocho committed Oct 16, 2023
1 parent 6383fba commit 7017ed3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/unit/test_routes_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ def mock_async_results_successful(monkeypatch):
"""Mock celery tasks results."""

class MockTask:
status = "SUCCESSFUL"

def get(*args, **kwargs):
pass

Expand All @@ -47,6 +49,8 @@ def mock_async_results_processing(monkeypatch):
"""Mock celery tasks results."""

class MockTask:
status = "PROCESSING"

def get(*args, **kwargs):
pass

Expand All @@ -65,6 +69,8 @@ def mock_async_results_failed(request, monkeypatch):
"""Mock celery tasks results."""

class MockTask:
status = "FAILED"

def get(*args, **kwargs):
raise QRCodeError("Mock error")

Expand Down

0 comments on commit 7017ed3

Please sign in to comment.