added adaptive quickshell
This commit is contained in:
1 parent
6eb56d2065
commit
5b33a73fd8
189 files changed
+8678
-15
No files matched your search
@@ -0,0 +1,25 @@
|
||||
import importlib.util
|
||||
from pathlib import Path
|
||||
from unittest.mock import patch
|
||||
import unittest
|
||||
|
||||
spec = importlib.util.spec_from_file_location('display_preview', Path(__file__).resolve().parents[1] / 'backend/display_preview.py')
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(module)
|
||||
|
||||
class PositionTests(unittest.TestCase):
|
||||
def test_negative_coordinates(self):
|
||||
self.assertIn(',-1920x0,', module.monitor_rule('DP-1', '1920x1080@60', '-1920x0', '1', 1))
|
||||
|
||||
def test_invalid_position(self):
|
||||
with self.assertRaises(ValueError):
|
||||
module.monitor_rule('DP-1', 'preferred', 'left', '1')
|
||||
|
||||
def test_preview_validates_coordinate_pair(self):
|
||||
with patch.object(module, 'current', return_value={'name':'DP-1','x':0,'y':0,'width':1920,'height':1080,'refreshRate':60,'scale':1,'transform':0}):
|
||||
with self.assertRaisesRegex(ValueError, 'вместе'):
|
||||
module.preview('DP-1', 'preferred', '1', '0', '10')
|
||||
with self.assertRaisesRegex(ValueError, 'координаты'):
|
||||
module.preview('DP-1', 'preferred', '1', '0', '999999', '0')
|
||||
|
||||
if __name__ == '__main__': unittest.main()
|
||||
Reference in new issue
Block a user