Skip to content

[TESTING] Write unit tests for noise and occupancy sensors #26

Closed
ezehf2 opened this issue Mar 11, 2026 · 1 comment
Closed

[TESTING] Write unit tests for noise and occupancy sensors #26

ezehf2 opened this issue Mar 11, 2026 · 1 comment
Assignees

Comments

@ezehf2
Copy link
Owner

ezehf2 commented Mar 11, 2026

Create tests/test_noise_sensor.py and tests/test_occupancy_sensor.py. Each file must test four things — that generate_reading() returns valid JSON, that all required fields are present (sensor_type, room, value, unit, timestamp), that the value falls within the expected range (noise 30–100 dB, occupancy 0 to room capacity), and that drift between consecutive readings does not exceed a reasonable step (noise max 5 dB per reading, occupancy max 3 people per reading). Run with pytest tests/ and paste the passing output as a comment on this issue before closing.

@mbaj2
Copy link
Collaborator

mbaj2 commented Mar 16, 2026

image

@mbaj2 mbaj2 closed this as completed Mar 16, 2026
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
Development

No branches or pull requests

2 participants