pep8 fix: assertEquals -> assertEqual
assertEquals is deprecated in py3, fixing in: dir: test/unit/cli/* Change-Id: I9a2fc1f717beafd5fa8408942046e310e8de0318
This commit is contained in:
parent
5b24b22498
commit
f449e91472
@ -128,7 +128,7 @@ Metadata:
|
|||||||
No system metadata found in db file
|
No system metadata found in db file
|
||||||
User Metadata: {'mydata': 'swift'}'''
|
User Metadata: {'mydata': 'swift'}'''
|
||||||
|
|
||||||
self.assertEquals(sorted(out.getvalue().strip().split('\n')),
|
self.assertEqual(sorted(out.getvalue().strip().split('\n')),
|
||||||
sorted(exp_out.split('\n')))
|
sorted(exp_out.split('\n')))
|
||||||
|
|
||||||
info = dict(
|
info = dict(
|
||||||
@ -175,7 +175,7 @@ Metadata:
|
|||||||
X-Container-Foo: bar
|
X-Container-Foo: bar
|
||||||
System Metadata: {'mydata': 'swift'}
|
System Metadata: {'mydata': 'swift'}
|
||||||
No user metadata found in db file''' % POLICIES[0].name
|
No user metadata found in db file''' % POLICIES[0].name
|
||||||
self.assertEquals(sorted(out.getvalue().strip().split('\n')),
|
self.assertEqual(sorted(out.getvalue().strip().split('\n')),
|
||||||
sorted(exp_out.split('\n')))
|
sorted(exp_out.split('\n')))
|
||||||
|
|
||||||
def test_print_ring_locations_invalid_args(self):
|
def test_print_ring_locations_invalid_args(self):
|
||||||
@ -306,7 +306,7 @@ No user metadata found in db file''' % POLICIES[0].name
|
|||||||
if exp_raised:
|
if exp_raised:
|
||||||
exp_out = 'Does not appear to be a DB of type "account":' \
|
exp_out = 'Does not appear to be a DB of type "account":' \
|
||||||
' ./d49d0ecbb53be1fcc49624f2f7c7ccae.db'
|
' ./d49d0ecbb53be1fcc49624f2f7c7ccae.db'
|
||||||
self.assertEquals(out.getvalue().strip(), exp_out)
|
self.assertEqual(out.getvalue().strip(), exp_out)
|
||||||
else:
|
else:
|
||||||
self.fail("Expected an InfoSystemExit exception to be raised")
|
self.fail("Expected an InfoSystemExit exception to be raised")
|
||||||
|
|
||||||
@ -334,7 +334,7 @@ class TestPrintObj(TestCliInfoBase):
|
|||||||
out = StringIO()
|
out = StringIO()
|
||||||
with mock.patch('sys.stdout', out):
|
with mock.patch('sys.stdout', out):
|
||||||
self.assertRaises(InfoSystemExit, print_obj, datafile)
|
self.assertRaises(InfoSystemExit, print_obj, datafile)
|
||||||
self.assertEquals(out.getvalue().strip(),
|
self.assertEqual(out.getvalue().strip(),
|
||||||
'Invalid metadata')
|
'Invalid metadata')
|
||||||
|
|
||||||
def test_print_obj_valid(self):
|
def test_print_obj_valid(self):
|
||||||
@ -489,7 +489,7 @@ Other Metadata:
|
|||||||
No metadata found''' % (
|
No metadata found''' % (
|
||||||
utils.Timestamp(106.3).internal)
|
utils.Timestamp(106.3).internal)
|
||||||
|
|
||||||
self.assertEquals(out.getvalue().strip(), exp_out)
|
self.assertEqual(out.getvalue().strip(), exp_out)
|
||||||
|
|
||||||
metadata = get_metadata({
|
metadata = get_metadata({
|
||||||
'X-Object-Sysmeta-Mtime': '107.3',
|
'X-Object-Sysmeta-Mtime': '107.3',
|
||||||
@ -514,7 +514,7 @@ Other Metadata:
|
|||||||
No metadata found''' % (
|
No metadata found''' % (
|
||||||
utils.Timestamp(106.3).internal)
|
utils.Timestamp(106.3).internal)
|
||||||
|
|
||||||
self.assertEquals(out.getvalue().strip(), exp_out)
|
self.assertEqual(out.getvalue().strip(), exp_out)
|
||||||
|
|
||||||
metadata = get_metadata({
|
metadata = get_metadata({
|
||||||
'X-Object-Meta-Mtime': '107.3',
|
'X-Object-Meta-Mtime': '107.3',
|
||||||
@ -539,7 +539,7 @@ Other Metadata:
|
|||||||
X-Object-Mtime: 107.3''' % (
|
X-Object-Mtime: 107.3''' % (
|
||||||
utils.Timestamp(106.3).internal)
|
utils.Timestamp(106.3).internal)
|
||||||
|
|
||||||
self.assertEquals(out.getvalue().strip(), exp_out)
|
self.assertEqual(out.getvalue().strip(), exp_out)
|
||||||
|
|
||||||
metadata = get_metadata({})
|
metadata = get_metadata({})
|
||||||
out = StringIO()
|
out = StringIO()
|
||||||
@ -560,7 +560,7 @@ Other Metadata:
|
|||||||
No metadata found''' % (
|
No metadata found''' % (
|
||||||
utils.Timestamp(106.3).internal)
|
utils.Timestamp(106.3).internal)
|
||||||
|
|
||||||
self.assertEquals(out.getvalue().strip(), exp_out)
|
self.assertEqual(out.getvalue().strip(), exp_out)
|
||||||
|
|
||||||
metadata = get_metadata({'X-Object-Meta-Mtime': '107.3'})
|
metadata = get_metadata({'X-Object-Meta-Mtime': '107.3'})
|
||||||
metadata['name'] = '/a-s'
|
metadata['name'] = '/a-s'
|
||||||
@ -583,7 +583,7 @@ Other Metadata:
|
|||||||
No metadata found''' % (
|
No metadata found''' % (
|
||||||
utils.Timestamp(106.3).internal)
|
utils.Timestamp(106.3).internal)
|
||||||
|
|
||||||
self.assertEquals(out.getvalue().strip(), exp_out)
|
self.assertEqual(out.getvalue().strip(), exp_out)
|
||||||
|
|
||||||
metadata = get_metadata({'X-Object-Meta-Mtime': '107.3'})
|
metadata = get_metadata({'X-Object-Meta-Mtime': '107.3'})
|
||||||
del metadata['Content-Type']
|
del metadata['Content-Type']
|
||||||
@ -605,7 +605,7 @@ Other Metadata:
|
|||||||
No metadata found''' % (
|
No metadata found''' % (
|
||||||
utils.Timestamp(106.3).internal)
|
utils.Timestamp(106.3).internal)
|
||||||
|
|
||||||
self.assertEquals(out.getvalue().strip(), exp_out)
|
self.assertEqual(out.getvalue().strip(), exp_out)
|
||||||
|
|
||||||
metadata = get_metadata({'X-Object-Meta-Mtime': '107.3'})
|
metadata = get_metadata({'X-Object-Meta-Mtime': '107.3'})
|
||||||
del metadata['X-Timestamp']
|
del metadata['X-Timestamp']
|
||||||
@ -626,7 +626,7 @@ User Metadata:
|
|||||||
Other Metadata:
|
Other Metadata:
|
||||||
No metadata found'''
|
No metadata found'''
|
||||||
|
|
||||||
self.assertEquals(out.getvalue().strip(), exp_out)
|
self.assertEqual(out.getvalue().strip(), exp_out)
|
||||||
|
|
||||||
|
|
||||||
class TestPrintObjWeirdPath(TestPrintObjFullMeta):
|
class TestPrintObjWeirdPath(TestPrintObjFullMeta):
|
||||||
|
@ -290,7 +290,7 @@ class TestRecon(unittest.TestCase):
|
|||||||
m = r.match(line)
|
m = r.match(line)
|
||||||
if m:
|
if m:
|
||||||
ex = expected.pop(m.group(1))
|
ex = expected.pop(m.group(1))
|
||||||
self.assertEquals(m.group(2),
|
self.assertEqual(m.group(2),
|
||||||
" low: %s, high: %s, avg: %s, total: %s,"
|
" low: %s, high: %s, avg: %s, total: %s,"
|
||||||
" Failed: %s%%, no_result: %s, reported: %s"
|
" Failed: %s%%, no_result: %s, reported: %s"
|
||||||
% ex)
|
% ex)
|
||||||
@ -328,7 +328,7 @@ class TestRecon(unittest.TestCase):
|
|||||||
for line in lines:
|
for line in lines:
|
||||||
m = r.match(line)
|
m = r.match(line)
|
||||||
if m:
|
if m:
|
||||||
self.assertEquals(m.group(2),
|
self.assertEqual(m.group(2),
|
||||||
" low: %s, high: %s, avg: %s, total: %s,"
|
" low: %s, high: %s, avg: %s, total: %s,"
|
||||||
" Failed: %s%%, no_result: %s, reported: %s"
|
" Failed: %s%%, no_result: %s, reported: %s"
|
||||||
% expected)
|
% expected)
|
||||||
|
@ -147,7 +147,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder._parse_search_values(argv)
|
ringbuilder._parse_search_values(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
def test_find_parts(self):
|
def test_find_parts(self):
|
||||||
rb = RingBuilder(8, 3, 0)
|
rb = RingBuilder(8, 3, 0)
|
||||||
@ -185,7 +185,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder._parse_list_parts_values(argv)
|
ringbuilder._parse_list_parts_values(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
def test_parse_add_values_number_of_arguments(self):
|
def test_parse_add_values_number_of_arguments(self):
|
||||||
# Test Number of arguments abnormal
|
# Test Number of arguments abnormal
|
||||||
@ -195,7 +195,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder._parse_add_values(argv)
|
ringbuilder._parse_add_values(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
def test_set_weight_values_no_devices(self):
|
def test_set_weight_values_no_devices(self):
|
||||||
# Test no devices
|
# Test no devices
|
||||||
@ -204,7 +204,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder._set_weight_values([], 100)
|
ringbuilder._set_weight_values([], 100)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
def test_parse_set_weight_values_number_of_arguments(self):
|
def test_parse_set_weight_values_number_of_arguments(self):
|
||||||
# Test Number of arguments abnormal
|
# Test Number of arguments abnormal
|
||||||
@ -214,7 +214,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder._parse_set_weight_values(argv)
|
ringbuilder._parse_set_weight_values(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
argv = ["--region", "2"]
|
argv = ["--region", "2"]
|
||||||
err = None
|
err = None
|
||||||
@ -222,7 +222,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder._parse_set_weight_values(argv)
|
ringbuilder._parse_set_weight_values(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
def test_set_info_values_no_devices(self):
|
def test_set_info_values_no_devices(self):
|
||||||
# Test no devices
|
# Test no devices
|
||||||
@ -231,7 +231,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder._set_info_values([], 100)
|
ringbuilder._set_info_values([], 100)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
def test_parse_set_info_values_number_of_arguments(self):
|
def test_parse_set_info_values_number_of_arguments(self):
|
||||||
# Test Number of arguments abnormal
|
# Test Number of arguments abnormal
|
||||||
@ -241,7 +241,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder._parse_set_info_values(argv)
|
ringbuilder._parse_set_info_values(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
def test_parse_remove_values_number_of_arguments(self):
|
def test_parse_remove_values_number_of_arguments(self):
|
||||||
# Test Number of arguments abnormal
|
# Test Number of arguments abnormal
|
||||||
@ -251,7 +251,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder._parse_remove_values(argv)
|
ringbuilder._parse_remove_values(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
def test_create_ring(self):
|
def test_create_ring(self):
|
||||||
argv = ["", self.tmpfile, "create", "6", "3.14159265359", "1"]
|
argv = ["", self.tmpfile, "create", "6", "3.14159265359", "1"]
|
||||||
@ -405,7 +405,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder.main(argv)
|
ringbuilder.main(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
def test_add_device_already_exists(self):
|
def test_add_device_already_exists(self):
|
||||||
# Test Add a device that already exists
|
# Test Add a device that already exists
|
||||||
@ -416,7 +416,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder.main(argv)
|
ringbuilder.main(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
def test_remove_device(self):
|
def test_remove_device(self):
|
||||||
for search_value in self.search_values:
|
for search_value in self.search_values:
|
||||||
@ -692,7 +692,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder.main(argv)
|
ringbuilder.main(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
def test_remove_device_no_matching(self):
|
def test_remove_device_no_matching(self):
|
||||||
self.create_sample_ring()
|
self.create_sample_ring()
|
||||||
@ -704,7 +704,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder.main(argv)
|
ringbuilder.main(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
def test_set_weight(self):
|
def test_set_weight(self):
|
||||||
for search_value in self.search_values:
|
for search_value in self.search_values:
|
||||||
@ -903,7 +903,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder.main(argv)
|
ringbuilder.main(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
def test_set_weight_no_matching(self):
|
def test_set_weight_no_matching(self):
|
||||||
self.create_sample_ring()
|
self.create_sample_ring()
|
||||||
@ -915,7 +915,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder.main(argv)
|
ringbuilder.main(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
def test_set_info(self):
|
def test_set_info(self):
|
||||||
for search_value in self.search_values:
|
for search_value in self.search_values:
|
||||||
@ -1195,7 +1195,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder.main(argv)
|
ringbuilder.main(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
def test_set_info_no_matching(self):
|
def test_set_info_no_matching(self):
|
||||||
self.create_sample_ring()
|
self.create_sample_ring()
|
||||||
@ -1207,7 +1207,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder.main(argv)
|
ringbuilder.main(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
def test_set_info_already_exists(self):
|
def test_set_info_already_exists(self):
|
||||||
self.create_sample_ring()
|
self.create_sample_ring()
|
||||||
@ -1230,7 +1230,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder.main(argv)
|
ringbuilder.main(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
def test_set_min_part_hours(self):
|
def test_set_min_part_hours(self):
|
||||||
self.create_sample_ring()
|
self.create_sample_ring()
|
||||||
@ -1247,7 +1247,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder.main(argv)
|
ringbuilder.main(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
def test_set_replicas(self):
|
def test_set_replicas(self):
|
||||||
self.create_sample_ring()
|
self.create_sample_ring()
|
||||||
@ -1321,7 +1321,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder.main(argv)
|
ringbuilder.main(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
def test_set_replicas_invalid_value(self):
|
def test_set_replicas_invalid_value(self):
|
||||||
# Test not a valid number
|
# Test not a valid number
|
||||||
@ -1331,7 +1331,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder.main(argv)
|
ringbuilder.main(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
# Test new replicas is 0
|
# Test new replicas is 0
|
||||||
argv = ["", self.tmpfile, "set_replicas", "0"]
|
argv = ["", self.tmpfile, "set_replicas", "0"]
|
||||||
@ -1340,7 +1340,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder.main(argv)
|
ringbuilder.main(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
def test_validate(self):
|
def test_validate(self):
|
||||||
self.create_sample_ring()
|
self.create_sample_ring()
|
||||||
@ -1358,7 +1358,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder.main(argv)
|
ringbuilder.main(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
def test_validate_corrupted_file(self):
|
def test_validate_corrupted_file(self):
|
||||||
self.create_sample_ring()
|
self.create_sample_ring()
|
||||||
@ -1376,7 +1376,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder.main(argv)
|
ringbuilder.main(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
def test_validate_non_existent_file(self):
|
def test_validate_non_existent_file(self):
|
||||||
rand_file = '%s/%s' % ('/tmp', str(uuid.uuid4()))
|
rand_file = '%s/%s' % ('/tmp', str(uuid.uuid4()))
|
||||||
@ -1386,7 +1386,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder.main(argv)
|
ringbuilder.main(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
def test_validate_non_accessible_file(self):
|
def test_validate_non_accessible_file(self):
|
||||||
with mock.patch.object(
|
with mock.patch.object(
|
||||||
@ -1398,7 +1398,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder.main(argv)
|
ringbuilder.main(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
def test_validate_generic_error(self):
|
def test_validate_generic_error(self):
|
||||||
with mock.patch.object(
|
with mock.patch.object(
|
||||||
@ -1410,7 +1410,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder.main(argv)
|
ringbuilder.main(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
def test_search_device_ipv4_old_format(self):
|
def test_search_device_ipv4_old_format(self):
|
||||||
self.create_sample_ring()
|
self.create_sample_ring()
|
||||||
@ -1510,7 +1510,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder.main(argv)
|
ringbuilder.main(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
def test_search_device_no_matching(self):
|
def test_search_device_no_matching(self):
|
||||||
self.create_sample_ring()
|
self.create_sample_ring()
|
||||||
@ -1522,7 +1522,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder.main(argv)
|
ringbuilder.main(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
def test_list_parts_ipv4_old_format(self):
|
def test_list_parts_ipv4_old_format(self):
|
||||||
self.create_sample_ring()
|
self.create_sample_ring()
|
||||||
@ -1622,7 +1622,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder.main(argv)
|
ringbuilder.main(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
def test_list_parts_no_matching(self):
|
def test_list_parts_no_matching(self):
|
||||||
self.create_sample_ring()
|
self.create_sample_ring()
|
||||||
@ -1634,7 +1634,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder.main(argv)
|
ringbuilder.main(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
def test_unknown(self):
|
def test_unknown(self):
|
||||||
argv = ["", self.tmpfile, "unknown"]
|
argv = ["", self.tmpfile, "unknown"]
|
||||||
@ -1643,7 +1643,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder.main(argv)
|
ringbuilder.main(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
def test_default(self):
|
def test_default(self):
|
||||||
self.create_sample_ring()
|
self.create_sample_ring()
|
||||||
@ -1669,7 +1669,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder.main(argv)
|
ringbuilder.main(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 1)
|
self.assertEqual(err.code, 1)
|
||||||
|
|
||||||
def test_rebalance_no_devices(self):
|
def test_rebalance_no_devices(self):
|
||||||
# Test no devices
|
# Test no devices
|
||||||
@ -1681,7 +1681,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder.main(argv)
|
ringbuilder.main(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
def test_write_ring(self):
|
def test_write_ring(self):
|
||||||
self.create_sample_ring()
|
self.create_sample_ring()
|
||||||
@ -1702,7 +1702,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder.main(argv)
|
ringbuilder.main(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
def test_warn_at_risk(self):
|
def test_warn_at_risk(self):
|
||||||
self.create_sample_ring()
|
self.create_sample_ring()
|
||||||
@ -1715,7 +1715,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder.main(argv)
|
ringbuilder.main(argv)
|
||||||
except SystemExit as e:
|
except SystemExit as e:
|
||||||
err = e
|
err = e
|
||||||
self.assertEquals(err.code, 1)
|
self.assertEqual(err.code, 1)
|
||||||
|
|
||||||
def test_invalid_device_name(self):
|
def test_invalid_device_name(self):
|
||||||
self.create_sample_ring()
|
self.create_sample_ring()
|
||||||
@ -1731,7 +1731,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder.main(argv)
|
ringbuilder.main(argv)
|
||||||
except SystemExit as exc:
|
except SystemExit as exc:
|
||||||
err = exc
|
err = exc
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
argv = ["",
|
argv = ["",
|
||||||
self.tmpfile,
|
self.tmpfile,
|
||||||
@ -1746,7 +1746,7 @@ class TestCommands(unittest.TestCase, RunSwiftRingBuilderMixin):
|
|||||||
ringbuilder.main(argv)
|
ringbuilder.main(argv)
|
||||||
except SystemExit as exc:
|
except SystemExit as exc:
|
||||||
err = exc
|
err = exc
|
||||||
self.assertEquals(err.code, 2)
|
self.assertEqual(err.code, 2)
|
||||||
|
|
||||||
def test_dispersion_command(self):
|
def test_dispersion_command(self):
|
||||||
self.create_sample_ring()
|
self.create_sample_ring()
|
||||||
|
Loading…
Reference in New Issue
Block a user