aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_display.py
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-11-09 19:43:48 +0100
committerDanilo M. <danix@danix.xyz>2026-11-09 19:43:48 +0100
commitfd9d6dafd12348e7ecd0aab216dfeda1fe13a088 (patch)
tree737877d6057d7ed08e85ee0ca64846afb728f9e5 /tests/test_display.py
parent05b01ce3ec09302fe1a47ff71540c91a92d1cab6 (diff)
downloaddeck-it-fd9d6dafd12348e7ecd0aab216dfeda1fe13a088.tar.gz
deck-it-fd9d6dafd12348e7ecd0aab216dfeda1fe13a088.zip
feat: paint the virtual monitor with the first monitor's swaybg wallpaper
Diffstat (limited to 'tests/test_display.py')
-rw-r--r--tests/test_display.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_display.py b/tests/test_display.py
index b5d5b11..b69759a 100644
--- a/tests/test_display.py
+++ b/tests/test_display.py
@@ -1,4 +1,5 @@
import sys
+import tempfile
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
@@ -21,5 +22,15 @@ class Resolution(unittest.TestCase):
"2560x1600")
+class Swaybg(unittest.TestCase):
+ def test_finds_the_image_for_an_output(self):
+ root = Path(tempfile.mkdtemp())
+ d = root / "123"
+ d.mkdir()
+ (d / "cmdline").write_bytes(b"/usr/bin/swaybg\0-o\0DP-1\0-i\0/a.png\0-m\0fill\0")
+ self.assertEqual(display._swaybg_for("DP-1", root), (123, "/a.png", "fill"))
+ self.assertIsNone(display._swaybg_for("TAB", root))
+
+
if __name__ == "__main__":
unittest.main()