aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_display.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/test_display.py b/tests/test_display.py
new file mode 100644
index 0000000..b5d5b11
--- /dev/null
+++ b/tests/test_display.py
@@ -0,0 +1,25 @@
+import sys
+from pathlib import Path
+
+sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
+
+import unittest
+
+import deckit.display as display
+
+
+class Resolution(unittest.TestCase):
+ def test_reads_adb(self):
+ self.assertEqual(
+ display.tablet_resolution({"display": {}}, adb=lambda: "Physical size: 1920x1200"),
+ "1920x1200")
+
+ def test_config_override(self):
+ self.assertEqual(
+ display.tablet_resolution({"display": {"resolution": "2560x1600"}},
+ adb=lambda: "1920x1200"),
+ "2560x1600")
+
+
+if __name__ == "__main__":
+ unittest.main()