Skip to content

[TESTING] Write unit tests for temperature and CO2 sensors #25

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

[TESTING] Write unit tests for temperature and CO2 sensors #25

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

Comments

@ezehf2
Copy link
Owner

ezehf2 commented Mar 11, 2026

Create tests/test_temperature_sensor.py and tests/test_co2_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 (temperature 18–30°C, CO2 400–1500 ppm). That drift between consecutive readings does not exceed a reasonable step (temperature max 1 degree per reading, CO2 max 50 ppm 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