aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_windows.py
blob: 1573a772a37c58971d94231b3d38b7f02a869c27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import sys
from pathlib import Path

sys.path.insert(0, str(Path(__file__).resolve().parent.parent))

import unittest

import deckit.modules.windows as windows


class Commands(unittest.TestCase):
    def test_lua_and_classic(self):
        self.assertEqual(windows.workspace_cmd(3, lua=False),
                         ["hyprctl", "dispatch", "workspace", "3"])
        self.assertEqual(windows.workspace_cmd(3, lua=True)[:2], ["hyprctl", "eval"])

    def test_address_guard(self):
        self.assertIsNone(windows.ADDR.fullmatch("0x1;rm"))
        self.assertTrue(windows.ADDR.fullmatch("0x55897e5c0800"))


if __name__ == "__main__":
    unittest.main()