Add pet/wildlife enums, event types, and MQTT topics
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
51
tests/unit/test_constants.py
Normal file
51
tests/unit/test_constants.py
Normal file
@@ -0,0 +1,51 @@
|
||||
"""Tests for new pet/wildlife constants."""
|
||||
|
||||
from vigilar.constants import (
|
||||
CameraLocation,
|
||||
EventType,
|
||||
ThreatLevel,
|
||||
Topics,
|
||||
)
|
||||
|
||||
|
||||
class TestThreatLevel:
|
||||
def test_values(self):
|
||||
assert ThreatLevel.PREDATOR == "PREDATOR"
|
||||
assert ThreatLevel.NUISANCE == "NUISANCE"
|
||||
assert ThreatLevel.PASSIVE == "PASSIVE"
|
||||
|
||||
def test_is_strenum(self):
|
||||
assert isinstance(ThreatLevel.PREDATOR, str)
|
||||
|
||||
|
||||
class TestCameraLocation:
|
||||
def test_values(self):
|
||||
assert CameraLocation.EXTERIOR == "EXTERIOR"
|
||||
assert CameraLocation.INTERIOR == "INTERIOR"
|
||||
assert CameraLocation.TRANSITION == "TRANSITION"
|
||||
|
||||
def test_is_strenum(self):
|
||||
assert isinstance(CameraLocation.EXTERIOR, str)
|
||||
|
||||
|
||||
class TestNewEventTypes:
|
||||
def test_pet_events_exist(self):
|
||||
assert EventType.PET_DETECTED == "PET_DETECTED"
|
||||
assert EventType.PET_ESCAPE == "PET_ESCAPE"
|
||||
assert EventType.UNKNOWN_ANIMAL == "UNKNOWN_ANIMAL"
|
||||
|
||||
def test_wildlife_events_exist(self):
|
||||
assert EventType.WILDLIFE_PREDATOR == "WILDLIFE_PREDATOR"
|
||||
assert EventType.WILDLIFE_NUISANCE == "WILDLIFE_NUISANCE"
|
||||
assert EventType.WILDLIFE_PASSIVE == "WILDLIFE_PASSIVE"
|
||||
|
||||
|
||||
class TestPetTopics:
|
||||
def test_pet_detected_topic(self):
|
||||
assert Topics.camera_pet_detected("front") == "vigilar/camera/front/pet/detected"
|
||||
|
||||
def test_wildlife_detected_topic(self):
|
||||
assert Topics.camera_wildlife_detected("front") == "vigilar/camera/front/wildlife/detected"
|
||||
|
||||
def test_pet_location_topic(self):
|
||||
assert Topics.pet_location("angel") == "vigilar/pets/angel/location"
|
||||
Reference in New Issue
Block a user