blob: c23d348e0a9c05f34422a1986ffde3e66a05f43a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
From 42cb14080bbb6acb8dbbb98f1a1f454f794692ed Mon Sep 17 00:00:00 2001
From: Timothy Gu <timothygu99@gmail.com>
Date: Thu, 15 Oct 2020 02:29:49 -0400
Subject: [PATCH 1/2] tests: Skip a test if virtual image driver is not enabled
test_manager_get_devices_on_name_appeared requires the virtual image
driver to be available.
---
tests/fprintd.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tests/fprintd.py b/tests/fprintd.py
index 0bd9ac3..06c65bc 100755
--- a/tests/fprintd.py
+++ b/tests/fprintd.py
@@ -270,6 +270,9 @@ class FPrintdTest(dbusmock.DBusTestCase):
return pwd.getpwuid(os.getuid()).pw_name
def setUp(self):
+ self.daemon = None
+ self.manager = None
+ self.device = None
self.test_dir = tempfile.mkdtemp()
self.addCleanup(shutil.rmtree, self.test_dir)
self.state_dir = os.path.join(self.test_dir, 'state')
@@ -325,8 +328,6 @@ class FPrintdVirtualDeviceBaseTest(FPrintdTest):
def setUp(self):
super().setUp()
- self.manager = None
- self.device = None
self.polkitd_start()
self.daemon_start()
@@ -441,6 +442,9 @@ class FPrintdManagerPreStartTests(FPrintdTest):
on_name_appeared, None)
self.daemon_start()
+ if self.device is None:
+ self.skipTest("Need virtual_image device to run the test")
+
while not self._appeared_res:
ctx.iteration(True)
--
2.28.0
|