diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-30 11:01:09 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-30 11:01:09 +0100 |
| commit | 88f120cb544296f4c760546a204f1e2268a2e5dd (patch) | |
| tree | be14896616b3733556f3bc10a1406fc3c84d6044 /tests | |
| parent | 96355cff09db091f5251ae851c46b8d1dd67f7a0 (diff) | |
| download | deck-it-88f120cb544296f4c760546a204f1e2268a2e5dd.tar.gz deck-it-88f120cb544296f4c760546a204f1e2268a2e5dd.zip | |
feat(dashboard): drop the action icons row
The screenshot and lock buttons went unused; the keyboard is faster.
The actions module keeps only the hyprlock watcher that sleeps and wakes
the tablet, under the same name since keystone's module toggle uses it.
[dashboard] actions is gone from the config and its validation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_actions.py | 32 | ||||
| -rw-r--r-- | tests/test_config.py | 9 |
2 files changed, 1 insertions, 40 deletions
diff --git a/tests/test_actions.py b/tests/test_actions.py index e6f31e3..3a79692 100644 --- a/tests/test_actions.py +++ b/tests/test_actions.py @@ -22,41 +22,9 @@ sys.path.insert(0, str(Path(__file__).resolve().parent.parent)) import subprocess import unittest -import deckit.config as config -from deckit.module import ModuleError from deckit.modules import actions -class Actions(unittest.TestCase): - def test_ids_match_the_config(self): - self.assertEqual(tuple(actions.ACTIONS), config.ACTION_IDS) - - def test_state_lists_the_configured_actions_in_order(self): - m = actions.make({"dashboard": {"actions": ["lock", "screenshot"]}}) - self.assertEqual([a["id"] for a in m.state()["actions"]], ["lock", "screenshot"]) - self.assertEqual(set(m.state()["actions"][0]), {"id", "label", "icon"}) - - def test_only_configured_actions_run(self): - calls = [] - m = actions.make({"dashboard": {"actions": ["lock"]}, "popen": calls.append}) - m.actions["lock"]({}) - self.assertEqual(calls, [["lock.sh"]]) - self.assertNotIn("screenshot", m.actions) - - def test_screenshot_opens_the_menu(self): - calls = [] - m = actions.make({"dashboard": {"actions": ["screenshot"]}, "popen": calls.append}) - m.actions["screenshot"]({}) - self.assertEqual(calls, [["qar-scrotmenu.sh"]]) - - def test_missing_command_is_a_module_error(self): - def missing(cmd): - raise FileNotFoundError(cmd[0]) - m = actions.make({"dashboard": {"actions": ["lock"]}, "popen": missing}) - with self.assertRaises(ModuleError): - m.actions["lock"]({}) - - class Follow(unittest.TestCase): def test_sleeps_on_lock_and_wakes_on_unlock(self): keys = [] diff --git a/tests/test_config.py b/tests/test_config.py index 906d8d3..928a8e8 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -39,17 +39,10 @@ class Config(unittest.TestCase): {"ports": {"command_center": 80}}, {"ports": {"command_center": 5900, "display": 5900}}, {"wifi": {"address": "x; rm -rf ~"}}, - {"launch": {"apps": ["ok", "../evil"]}}, - {"dashboard": {"actions": ["screenshot", "rm -rf"]}}, - {"dashboard": {"actions": "lock"}}] + {"launch": {"apps": ["ok", "../evil"]}}] for cfg in bad: self.assertIsNotNone(config.config_error(cfg), cfg) - def test_dashboard_actions(self): - self.assertIsNone(config.config_error({"dashboard": {"actions": []}})) - self.assertIsNone(config.config_error({"dashboard": {"actions": ["lock", "screenshot"]}})) - self.assertEqual(config.ACTION_IDS, ("screenshot", "lock")) - def test_user_file_overrides_key_by_key(self): cfg = config.merge({"display": {"enabled": True, "scale": 1}, "launch": {"apps": ["a", "b"]}}, {"display": {"enabled": False}, "launch": {"apps": ["c"]}}) |
