tests: qvm_start_gui: make PEP8 happier
This commit is contained in:
parent
63e63f0bcf
commit
f7740546c9
@ -54,7 +54,8 @@ class TC_00_qvm_start_gui(qubesadmin.tests.QubesTestCase):
|
|||||||
args = self.launcher.kde_guid_args(self.app.domains['test-vm'])
|
args = self.launcher.kde_guid_args(self.app.domains['test-vm'])
|
||||||
self.assertEqual(args, ['-T', '-p',
|
self.assertEqual(args, ['-T', '-p',
|
||||||
'_KDE_NET_WM_COLOR_SCHEME=s:' +
|
'_KDE_NET_WM_COLOR_SCHEME=s:' +
|
||||||
os.path.expanduser('~/.local/share/qubes-kde/red.colors')])
|
os.path.expanduser(
|
||||||
|
'~/.local/share/qubes-kde/red.colors')])
|
||||||
|
|
||||||
self.assertAllCalled()
|
self.assertAllCalled()
|
||||||
|
|
||||||
@ -275,9 +276,11 @@ class TC_00_qvm_start_gui(qubesadmin.tests.QubesTestCase):
|
|||||||
|
|
||||||
patch_proc = unittest.mock.patch('asyncio.create_subprocess_exec')
|
patch_proc = unittest.mock.patch('asyncio.create_subprocess_exec')
|
||||||
patch_args = unittest.mock.patch.object(self.launcher,
|
patch_args = unittest.mock.patch.object(self.launcher,
|
||||||
'common_guid_args', lambda vm: [])
|
'common_guid_args',
|
||||||
|
lambda vm: [])
|
||||||
patch_pidfile = unittest.mock.patch.object(self.launcher,
|
patch_pidfile = unittest.mock.patch.object(self.launcher,
|
||||||
'guid_pidfile', lambda vm: pidfile.name)
|
'guid_pidfile',
|
||||||
|
lambda vm: pidfile.name)
|
||||||
try:
|
try:
|
||||||
mock_proc = patch_proc.start()
|
mock_proc = patch_proc.start()
|
||||||
patch_args.start()
|
patch_args.start()
|
||||||
@ -315,7 +318,8 @@ class TC_00_qvm_start_gui(qubesadmin.tests.QubesTestCase):
|
|||||||
b'2\x00QubesFeatureNotFoundError\x00\x00Feature not set\x00'
|
b'2\x00QubesFeatureNotFoundError\x00\x00Feature not set\x00'
|
||||||
proc_mock = unittest.mock.Mock()
|
proc_mock = unittest.mock.Mock()
|
||||||
with unittest.mock.patch('asyncio.create_subprocess_exec',
|
with unittest.mock.patch('asyncio.create_subprocess_exec',
|
||||||
lambda *args: self.mock_coroutine(proc_mock, *args)):
|
lambda *args: self.mock_coroutine(proc_mock,
|
||||||
|
*args)):
|
||||||
with unittest.mock.patch.object(self.launcher,
|
with unittest.mock.patch.object(self.launcher,
|
||||||
'common_guid_args', lambda vm: []):
|
'common_guid_args', lambda vm: []):
|
||||||
loop.run_until_complete(self.launcher.start_gui_for_stubdomain(
|
loop.run_until_complete(self.launcher.start_gui_for_stubdomain(
|
||||||
@ -348,7 +352,8 @@ class TC_00_qvm_start_gui(qubesadmin.tests.QubesTestCase):
|
|||||||
b'0\x001'
|
b'0\x001'
|
||||||
proc_mock = unittest.mock.Mock()
|
proc_mock = unittest.mock.Mock()
|
||||||
with unittest.mock.patch('asyncio.create_subprocess_exec',
|
with unittest.mock.patch('asyncio.create_subprocess_exec',
|
||||||
lambda *args: self.mock_coroutine(proc_mock, *args)):
|
lambda *args: self.mock_coroutine(proc_mock,
|
||||||
|
*args)):
|
||||||
with unittest.mock.patch.object(self.launcher,
|
with unittest.mock.patch.object(self.launcher,
|
||||||
'common_guid_args', lambda vm: []):
|
'common_guid_args', lambda vm: []):
|
||||||
loop.run_until_complete(self.launcher.start_gui_for_stubdomain(
|
loop.run_until_complete(self.launcher.start_gui_for_stubdomain(
|
||||||
@ -465,7 +470,8 @@ HDMI1 connected 2560x1920+0+0 (normal left inverted right x axis y axis) 372mm x
|
|||||||
dpi = 150
|
dpi = 150
|
||||||
self.assertEqual(qubesadmin.tools.qvm_start_gui.get_monitor_layout(),
|
self.assertEqual(qubesadmin.tools.qvm_start_gui.get_monitor_layout(),
|
||||||
['2560 1920 0 0 {} {}\n'.format(
|
['2560 1920 0 0 {} {}\n'.format(
|
||||||
int(2560/dpi*254/10), int(1920/dpi*254/10))])
|
int(2560 / dpi * 254 / 10),
|
||||||
|
int(1920 / dpi * 254 / 10))])
|
||||||
|
|
||||||
@unittest.mock.patch('subprocess.Popen')
|
@unittest.mock.patch('subprocess.Popen')
|
||||||
def test_052_get_monitor_layout_hidpi2(self, proc_mock):
|
def test_052_get_monitor_layout_hidpi2(self, proc_mock):
|
||||||
@ -476,7 +482,8 @@ HDMI1 connected 2560x1920+0+0 (normal left inverted right x axis y axis) 310mm x
|
|||||||
dpi = 200
|
dpi = 200
|
||||||
self.assertEqual(qubesadmin.tools.qvm_start_gui.get_monitor_layout(),
|
self.assertEqual(qubesadmin.tools.qvm_start_gui.get_monitor_layout(),
|
||||||
['2560 1920 0 0 {} {}\n'.format(
|
['2560 1920 0 0 {} {}\n'.format(
|
||||||
int(2560/dpi*254/10), int(1920/dpi*254/10))])
|
int(2560 / dpi * 254 / 10),
|
||||||
|
int(1920 / dpi * 254 / 10))])
|
||||||
|
|
||||||
@unittest.mock.patch('subprocess.Popen')
|
@unittest.mock.patch('subprocess.Popen')
|
||||||
def test_052_get_monitor_layout_hidpi3(self, proc_mock):
|
def test_052_get_monitor_layout_hidpi3(self, proc_mock):
|
||||||
@ -487,7 +494,8 @@ HDMI1 connected 2560x1920+0+0 (normal left inverted right x axis y axis) 206mm x
|
|||||||
dpi = 300
|
dpi = 300
|
||||||
self.assertEqual(qubesadmin.tools.qvm_start_gui.get_monitor_layout(),
|
self.assertEqual(qubesadmin.tools.qvm_start_gui.get_monitor_layout(),
|
||||||
['2560 1920 0 0 {} {}\n'.format(
|
['2560 1920 0 0 {} {}\n'.format(
|
||||||
int(2560/dpi*254/10), int(1920/dpi*254/10))])
|
int(2560 / dpi * 254 / 10),
|
||||||
|
int(1920 / dpi * 254 / 10))])
|
||||||
|
|
||||||
def test_060_send_monitor_layout(self):
|
def test_060_send_monitor_layout(self):
|
||||||
loop = asyncio.new_event_loop()
|
loop = asyncio.new_event_loop()
|
||||||
|
Loading…
Reference in New Issue
Block a user