]> sourceware.org Git - lvm2.git/commitdiff
lvmdbustest.py: Add nested helper function major_minor
authorTony Asleson <tasleson@redhat.com>
Wed, 9 Oct 2019 16:48:00 +0000 (11:48 -0500)
committerTony Asleson <tasleson@redhat.com>
Wed, 30 Oct 2019 15:38:40 +0000 (10:38 -0500)
test/dbus/lvmdbustest.py

index a9d7fac74abc703d24641eb02b8895a9d50c5cd7..0b7140a8983473c360437b99914fbcf905251a27 100755 (executable)
@@ -1316,6 +1316,10 @@ class TestDbusService(unittest.TestCase):
                                EOD))
 
        def test_pv_scan(self):
+
+               def major_minor(d):
+                       return (int(d.properties['MAJOR']), int(d.properties['MINOR']))
+
                devices = TestDbusService._get_devices()
 
                self.assertEqual(self._pv_scan(False, True, [], []), '/')
@@ -1327,8 +1331,7 @@ class TestDbusService(unittest.TestCase):
                self.assertEqual(self._pv_scan(False, True, block_path, []), '/')
                self._check_consistency()
 
-               mm = [(int(d.properties['MAJOR']), int(d.properties['MINOR']))
-                               for d in devices]
+               mm = [major_minor(d) for d in devices]
 
                self.assertEqual(self._pv_scan(False, True, block_path, mm), '/')
                self._check_consistency()
This page took 0.034839 seconds and 5 git commands to generate.