From 73840b30b9943e9b7de03e6172dbe7a51582ff94 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 17 Jul 2026 09:33:16 +0200 Subject: feat: parse hyprsunset.conf profiles Implement minimal config parser with Profile dataclass and parse_config function. Regex-based parsing of hyprsunset.conf format with support for time, identity, temperature, and gamma fields. Foundation for later tasks (serialize, read/write, validation). Co-Authored-By: Claude Opus 4.8 --- tests/test_config.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tests/test_config.py (limited to 'tests') diff --git a/tests/test_config.py b/tests/test_config.py new file mode 100644 index 0000000..4568160 --- /dev/null +++ b/tests/test_config.py @@ -0,0 +1,25 @@ +from hyprsunset_qt.config import Profile, parse_config + + +def test_parse_two_profiles(): + text = """ +profile { + time = 5:00 + identity = true +} + +profile { + time = 19:40 + temperature = 5500 + gamma = 0.8 +} +""" + profiles = parse_config(text) + assert profiles == [ + Profile(time="5:00", identity=True, temperature=None, gamma=None), + Profile(time="19:40", identity=False, temperature=5500, gamma=0.8), + ] + + +def test_parse_empty(): + assert parse_config("") == [] -- cgit v1.2.3