summaryrefslogtreecommitdiff
path: root/test/api
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2018-05-18 16:23:10 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2018-05-18 16:25:44 +0200
commitb2574c2f3a4a35b7ea3f51dc776cc64ebbe88ba8 (patch)
treee10ba62b86aa7dbe48bd29f5acf564208653d725 /test/api
parent3bbdde808a9dcb55a9ffd092e931dff80814daa7 (diff)
downloadlvm2-b2574c2f3a4a35b7ea3f51dc776cc64ebbe88ba8.tar.gz
python: use // for integer division
Diffstat (limited to 'test/api')
-rwxr-xr-xtest/api/python_lvm_unit.py.in10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/api/python_lvm_unit.py.in b/test/api/python_lvm_unit.py.in
index 2f9cbb515..78ced7e31 100755
--- a/test/api/python_lvm_unit.py.in
+++ b/test/api/python_lvm_unit.py.in
@@ -112,7 +112,7 @@ class TestLvm(unittest.TestCase):
for d in device_list:
vg.extend(d)
- vg.createLvLinear(name, vg.getSize() / 2)
+ vg.createLvLinear(name, vg.getSize() // 2)
vg.close()
vg = None
@@ -124,14 +124,14 @@ class TestLvm(unittest.TestCase):
vg.extend(d)
vg.createLvThinpool(
- pool_name, vg.getSize() / 2, 0, 0, lvm.THIN_DISCARDS_PASSDOWN, 1)
+ pool_name, vg.getSize() // 2, 0, 0, lvm.THIN_DISCARDS_PASSDOWN, 1)
return vg
@staticmethod
def _create_thin_lv(pv_devices, name):
thin_pool_name = 'thin_vg_pool_' + rs(4)
vg = TestLvm._create_thin_pool(pv_devices, thin_pool_name)
- vg.createLvThin(thin_pool_name, name, vg.getSize() / 8)
+ vg.createLvThin(thin_pool_name, name, vg.getSize() // 8)
vg.close()
vg = None
@@ -231,7 +231,7 @@ class TestLvm(unittest.TestCase):
curr_size = pv.getSize()
dev_size = pv.getDevSize()
self.assertTrue(curr_size == dev_size)
- pv.resize(curr_size / 2)
+ pv.resize(curr_size // 2)
with AllowedPVS() as pvs:
pv = pvs[0]
resized_size = pv.getSize()
@@ -718,7 +718,7 @@ class TestLvm(unittest.TestCase):
def test_percent_to_float(self):
self.assertEqual(lvm.percentToFloat(0), 0.0)
self.assertEqual(lvm.percentToFloat(1000000), 1.0)
- self.assertEqual(lvm.percentToFloat(1000000 / 2), 0.5)
+ self.assertEqual(lvm.percentToFloat(1000000 // 2), 0.5)
def test_scan(self):
self.assertEqual(lvm.scan(), None)