summaryrefslogtreecommitdiffstats
path: root/nova/tests
diff options
context:
space:
mode:
authorZhongyue Luo <zhongyue.nah@intel.com>2013-06-14 09:22:54 +0800
committerZhongyue Luo <zhongyue.nah@intel.com>2013-06-14 09:35:00 +0800
commitfc217a996a251d1c9e4f495f6d0fbf80b80700bc (patch)
tree84fdfb4d0bbc4f99c05b65b7a22f3e0426f65db6 /nova/tests
parentab1977af316eef5375c7aaefdf364548b4fb5289 (diff)
Replace utils.to_bytes() with strutils.to_bytes()
The to_bytes() function have moved to oslo. Replaced/removed the to_bytes() function with the one in strutils Change-Id: I14c33c6fb86db3088c11e02ce6e38ec022fad042
Diffstat (limited to 'nova/tests')
-rw-r--r--nova/tests/test_utils.py35
1 files changed, 0 insertions, 35 deletions
diff --git a/nova/tests/test_utils.py b/nova/tests/test_utils.py
index f400bb899..609280261 100644
--- a/nova/tests/test_utils.py
+++ b/nova/tests/test_utils.py
@@ -38,41 +38,6 @@ from nova import utils
CONF = cfg.CONF
-class ByteConversionTest(test.TestCase):
- def test_string_conversions(self):
- working_examples = {
- '1024KB': 1048576,
- '1024TB': 1125899906842624,
- '1024K': 1048576,
- '1024T': 1125899906842624,
- '1TB': 1099511627776,
- '1T': 1099511627776,
- '1KB': 1024,
- '1K': 1024,
- '1B': 1,
- '1B': 1,
- '1': 1,
- '1MB': 1048576,
- '7MB': 7340032,
- '0MB': 0,
- '0KB': 0,
- '0TB': 0,
- '': 0,
- }
- for (in_value, expected_value) in working_examples.items():
- b_value = utils.to_bytes(in_value)
- self.assertEquals(expected_value, b_value)
- if len(in_value):
- in_value = "-" + in_value
- b_value = utils.to_bytes(in_value)
- self.assertEquals(expected_value * -1, b_value)
- breaking_examples = [
- 'junk1KB', '1023BBBB',
- ]
- for v in breaking_examples:
- self.assertRaises(TypeError, utils.to_bytes, v)
-
-
class GetFromPathTestCase(test.TestCase):
def test_tolerates_nones(self):
f = utils.get_from_path