feat: project skeleton with config, dependencies, and test setup
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
17
tests/test_config.py
Normal file
17
tests/test_config.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import os
|
||||
from mqtt_home.config import Settings
|
||||
|
||||
|
||||
def test_default_settings():
|
||||
s = Settings()
|
||||
assert s.mqtt_host == "localhost"
|
||||
assert s.mqtt_port == 1883
|
||||
assert s.web_port == 8000
|
||||
|
||||
|
||||
def test_settings_from_env(monkeypatch):
|
||||
monkeypatch.setenv("MQTT_HOST", "192.168.1.1")
|
||||
monkeypatch.setenv("MQTT_PORT", "1884")
|
||||
s = Settings()
|
||||
assert s.mqtt_host == "192.168.1.1"
|
||||
assert s.mqtt_port == 1884
|
||||
Reference in New Issue
Block a user