summaryrefslogtreecommitdiffstats
path: root/tests/test_config.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_config.py')
-rw-r--r--tests/test_config.py25
1 files changed, 25 insertions, 0 deletions
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("") == []