diff options
Diffstat (limited to 'tests/test_actions.py')
| -rw-r--r-- | tests/test_actions.py | 32 |
1 files changed, 0 insertions, 32 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 = [] |
