aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_config.py
blob: 4568160cf9d81bd942588710484a363f49d644d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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("") == []