aboutsummaryrefslogtreecommitdiffstats
path: root/test_cal_notif.py
diff options
context:
space:
mode:
Diffstat (limited to 'test_cal_notif.py')
-rw-r--r--test_cal_notif.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/test_cal_notif.py b/test_cal_notif.py
index 0bb647c..89ff1ee 100644
--- a/test_cal_notif.py
+++ b/test_cal_notif.py
@@ -79,6 +79,29 @@ def test_config():
raise AssertionError
except ValueError:
pass
+ p.write_text('[voice]\nsay = "Fra {minuti}: {summary}"\n')
+ try:
+ cn.load_config(p)
+ raise AssertionError
+ except ValueError:
+ pass
+
+
+def test_overrides_validate():
+ with tempfile.TemporaryDirectory() as d:
+ p = Path(d) / "overrides.toml"
+ p.write_text('"x" = ["1hour"]\n')
+ try:
+ cn.load_overrides(p)
+ raise AssertionError
+ except ValueError:
+ pass
+ p.write_text('"x" = "1h"\n')
+ try:
+ cn.load_overrides(p)
+ raise AssertionError
+ except ValueError:
+ pass
def test_expand():
@@ -198,6 +221,8 @@ def test_choice():
assert cn.parse_choice("90m") == ["1h 30m"]
assert cn.parse_choice("none") == []
assert cn.parse_choice("reset") is None
+ assert cn.parse_choice("Reset") is None
+ assert cn.parse_choice("NONE") == []
try:
cn.parse_choice("soon")
raise AssertionError