Skip to content

Commit 766644b

Browse files
authored
Merge pull request #84 from GabrielSalla/add-procedures-tests
Add procedures tests
2 parents 89851a3 + 76d2cab commit 766644b

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

tests/components/controller/procedures/test_monitors_stuck.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import pytest
55

66
import components.controller.procedures.monitors_stuck as monitors_stuck
7+
from configs import configs
78
from models import Monitor
89
from tests.test_utils import assert_message_in_log, assert_message_not_in_log
910
from utils.time import now
@@ -20,6 +21,10 @@ def get_time(reference: str) -> datetime | None:
2021
return values.get(reference)
2122

2223

24+
async def test_configuration():
25+
assert "monitors_stuck" in configs.controller_procedures
26+
27+
2328
@pytest.mark.parametrize("enabled", [False, True])
2429
@pytest.mark.parametrize("queued", [False, True])
2530
@pytest.mark.parametrize("running", [False, True])

tests/components/controller/procedures/test_notification_alert_solved.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import pytest
55

66
import components.controller.procedures.notifications_alert_solved as notifications_alert_solved
7+
from configs import configs
78
from models import Alert, AlertStatus, Monitor, Notification, NotificationStatus
89
from tests.test_utils import assert_message_in_log, assert_message_not_in_log
910
from utils.time import now
@@ -20,6 +21,10 @@ def get_time(reference: str) -> datetime | None:
2021
return values.get(reference)
2122

2223

24+
async def test_configuration():
25+
assert "notifications_alert_solved" in configs.controller_procedures
26+
27+
2328
@pytest.mark.parametrize("alert_status", [AlertStatus.active, AlertStatus.solved])
2429
@pytest.mark.parametrize(
2530
"notification_status", [NotificationStatus.active, NotificationStatus.closed]

tests/conftest.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,7 @@ async def start_queue():
156156

157157
@pytest.fixture(scope="function")
158158
def clear_queue():
159-
"""Clear the internal queue. Ignoring the 'attr-defined' error because the Protocol doesn't
160-
have the attribute '_queue', but the 'InternalQueue' class does"""
159+
"""Clear the internal queue."""
161160
get_queue_items()
162161

163162

0 commit comments

Comments
 (0)