[blivet:master 01/20] Get rid of unnecessary use of long.
mulhern
amulhern at redhat.com
Tue Dec 23 23:42:14 UTC 2014
Python 2.7 will do all the necessary conversion to long if required.
Get rid of Python 3 compatibility stuff as well.
This is the last of explicit use of long in blivet.
Signed-off-by: mulhern <amulhern at redhat.com>
---
tests/size_test.py | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/tests/size_test.py b/tests/size_test.py
index c587ee0..25cda3f 100644
--- a/tests/size_test.py
+++ b/tests/size_test.py
@@ -27,16 +27,11 @@ import unittest
from decimal import Decimal
-import six
-
from blivet.i18n import _
from blivet.errors import SizePlacesError
from blivet import size
from blivet.size import Size, _EMPTY_PREFIX, _BINARY_PREFIXES, _DECIMAL_PREFIXES
-if six.PY3:
- long = int # pylint: disable=redefined-builtin
-
class SizeTestCase(unittest.TestCase):
def testExceptions(self):
@@ -73,17 +68,17 @@ class SizeTestCase(unittest.TestCase):
self.assertEquals(s.convertTo(), numbytes)
def testPrefixes(self):
- numbytes = long(47)
+ numbytes = 47
self._prefixTestHelper(numbytes, 1, None, None)
for factor, prefix, abbr in [_EMPTY_PREFIX] + _BINARY_PREFIXES + _DECIMAL_PREFIXES:
self._prefixTestHelper(numbytes, factor, prefix, abbr)
def testHumanReadable(self):
- s = Size(long(58929971))
+ s = Size(58929971)
self.assertEquals(s.humanReadable(), "56.2 MiB")
- s = Size(long(478360371))
+ s = Size(478360371)
self.assertEquals(s.humanReadable(), "456.2 MiB")
# humanReable output should be the same as input for big enough sizes
--
1.9.3
More information about the anaconda-patches
mailing list