aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_windows.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_windows.py')
-rw-r--r--tests/test_windows.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_windows.py b/tests/test_windows.py
index 1573a77..6aa7925 100644
--- a/tests/test_windows.py
+++ b/tests/test_windows.py
@@ -18,6 +18,16 @@ class Commands(unittest.TestCase):
self.assertIsNone(windows.ADDR.fullmatch("0x1;rm"))
self.assertTrue(windows.ADDR.fullmatch("0x55897e5c0800"))
+ def test_state_lists_all_workspaces(self):
+ responses = {
+ ("hyprctl", "clients", "-j"): "[]",
+ ("hyprctl", "activewindow", "-j"): "{}",
+ ("hyprctl", "monitors", "-j"): "[]",
+ ("hyprctl", "workspaces", "-j"): '[{"id": 1}, {"id": 2}, {"id": 5}]',
+ }
+ st = windows._state(lambda cmd: responses[tuple(cmd)])
+ self.assertEqual(st["workspaces"], [1, 2, 5])
+
if __name__ == "__main__":
unittest.main()