[blivet:master 02/20] Make possiblePhysicalExtents() a bit more direct.

mulhern amulhern at redhat.com
Tue Dec 23 23:42:15 UTC 2014


Remove corresponding tests because now it just duplicates the code
except where it uses xrange (which is missing from Python3).

Signed-off-by: mulhern <amulhern at redhat.com>
---
 blivet/devicelibs/lvm.py          | 9 +--------
 tests/devicelibs_test/lvm_test.py | 5 -----
 2 files changed, 1 insertion(+), 13 deletions(-)

diff --git a/blivet/devicelibs/lvm.py b/blivet/devicelibs/lvm.py
index 1bf87fa..3559dab 100644
--- a/blivet/devicelibs/lvm.py
+++ b/blivet/devicelibs/lvm.py
@@ -129,14 +129,7 @@ def getPossiblePhysicalExtents():
         :returns: list of possible extent sizes (:class:`~.size.Size`)
         :rtype: list
     """
-
-    possiblePE = []
-    curpe = Size("1 KiB")
-    while curpe <= Size("16 GiB"):
-        possiblePE.append(curpe)
-        curpe = curpe * 2
-
-    return possiblePE
+    return [Size(1024 * (2 ** n)) for n in range(25)]
 
 def getMaxLVSize():
     """ Return the maximum size of a logical volume. """
diff --git a/tests/devicelibs_test/lvm_test.py b/tests/devicelibs_test/lvm_test.py
index 5518f16..6fc81fd 100755
--- a/tests/devicelibs_test/lvm_test.py
+++ b/tests/devicelibs_test/lvm_test.py
@@ -12,11 +12,6 @@ from tests import loopbackedtestcase
 
 class LVMTestCase(unittest.TestCase):
 
-    def testGetPossiblePhysicalExtents(self):
-        # pass
-        self.assertEqual(lvm.getPossiblePhysicalExtents(),
-                         [Size("%d KiB" % 2**power) for power in xrange(0, 25)])
-
     def testClampSize(self):
         # pass
         self.assertEqual(lvm.clampSize(Size("10 MiB"), Size("4 MiB")),
-- 
1.9.3



More information about the anaconda-patches mailing list