diff options
| author | sommerfeld <sommerfeld@sommerfeld.dev> | 2026-09-26 22:23:04 +0100 |
|---|---|---|
| committer | sommerfeld <sommerfeld@sommerfeld.dev> | 2026-09-26 22:23:04 +0100 |
| commit | 869ea8436d9cf9d5748e6c089cc0b0b58358e75f (patch) | |
| tree | 57d765d0a975b67573673f13d00a1584cb2c35f4 /tests/test_workspace_cycle.py | |
| parent | d6f4aee0ccf47dea61204f4af44d8eed2e65f96c (diff) | |
| download | dotfiles-869ea8436d9cf9d5748e6c089cc0b0b58358e75f.tar.gz dotfiles-869ea8436d9cf9d5748e6c089cc0b0b58358e75f.tar.bz2 dotfiles-869ea8436d9cf9d5748e6c089cc0b0b58358e75f.zip | |
Align GNOME shortcuts with the Sway setup
Diffstat (limited to 'tests/test_workspace_cycle.py')
| -rw-r--r-- | tests/test_workspace_cycle.py | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/test_workspace_cycle.py b/tests/test_workspace_cycle.py new file mode 100644 index 0000000..09dbc2a --- /dev/null +++ b/tests/test_workspace_cycle.py @@ -0,0 +1,38 @@ +import json +import subprocess +import unittest +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] +EXTENSION = ROOT / "dot_local/share/gnome-shell/extensions/workspace-cycle@dotfiles" + + +class WorkspaceCycleTests(unittest.TestCase): + def test_schema_and_metadata(self): + metadata = json.loads((EXTENSION / "metadata.json").read_text()) + self.assertEqual(metadata["uuid"], "workspace-cycle@dotfiles") + self.assertEqual(metadata["shell-version"], ["50"]) + subprocess.run( + [ + "glib-compile-schemas", + "--strict", + "--dry-run", + str(EXTENSION / "schemas"), + ], + check=True, + ) + + def test_cycle_wraps_in_both_directions_and_releases_keys(self): + source = "\n".join( + line + for line in (EXTENSION / "extension.js").read_text().splitlines() + if not line.startswith("import ") + ) + source = source.replace("export default class", "class") + harness = (ROOT / "tests/fixtures/workspace-cycle.js").read_text() + subprocess.run( + ["node", "--input-type=module"], + input=harness.replace("// EXTENSION", source), + text=True, + check=True, + ) |
