pep8 fix: assertNotEquals -> assertNotEqual
assertNotEquals is deprecated in py3 Change-Id: Ib611351987bed1199fb8f73a750955a61d022d0a
This commit is contained in:
parent
f5f9d791b0
commit
1882801be1
@ -662,7 +662,7 @@ class TestAuth(unittest.TestCase):
|
||||
(0, 'test,test:tester'))
|
||||
resp = req.get_response(self.test_auth)
|
||||
self.assertEqual(resp.status_int, 200)
|
||||
self.assertNotEquals(resp.headers['x-auth-token'], 'uuid_token')
|
||||
self.assertNotEqual(resp.headers['x-auth-token'], 'uuid_token')
|
||||
self.assertEqual(resp.headers['x-auth-token'][:7], 'AUTH_tk')
|
||||
|
||||
def test_old_token_with_old_data(self):
|
||||
@ -680,7 +680,7 @@ class TestAuth(unittest.TestCase):
|
||||
(time() + 99, 'test,test:tester,.role'))
|
||||
resp = req.get_response(self.test_auth)
|
||||
self.assertEqual(resp.status_int, 200)
|
||||
self.assertNotEquals(resp.headers['x-auth-token'], 'uuid_token')
|
||||
self.assertNotEqual(resp.headers['x-auth-token'], 'uuid_token')
|
||||
self.assertEqual(resp.headers['x-auth-token'][:7], 'AUTH_tk')
|
||||
|
||||
def test_reseller_admin_is_owner(self):
|
||||
|
@ -165,7 +165,7 @@ class TestRingBuilder(unittest.TestCase):
|
||||
r2 = rb2.get_ring()
|
||||
|
||||
self.assertFalse(rb0.get_ring() is r0)
|
||||
self.assertNotEquals(r0.to_dict(), r1.to_dict())
|
||||
self.assertNotEqual(r0.to_dict(), r1.to_dict())
|
||||
self.assertEqual(r1.to_dict(), r2.to_dict())
|
||||
|
||||
def test_rebalance_part_on_deleted_other_part_on_drained(self):
|
||||
@ -1727,12 +1727,12 @@ class TestRingBuilder(unittest.TestCase):
|
||||
|
||||
# Validate that zero weight devices with no partitions don't count on
|
||||
# the 'worst' value.
|
||||
self.assertNotEquals(rb.validate(stats=True)[1], MAX_BALANCE)
|
||||
self.assertNotEqual(rb.validate(stats=True)[1], MAX_BALANCE)
|
||||
rb.add_dev({'id': 16, 'region': 0, 'zone': 0, 'weight': 0,
|
||||
'ip': '127.0.0.1', 'port': 10004, 'device': 'sda1'})
|
||||
rb.pretend_min_part_hours_passed()
|
||||
rb.rebalance()
|
||||
self.assertNotEquals(rb.validate(stats=True)[1], MAX_BALANCE)
|
||||
self.assertNotEqual(rb.validate(stats=True)[1], MAX_BALANCE)
|
||||
|
||||
def test_validate_partial_replica(self):
|
||||
rb = ring.RingBuilder(8, 2.5, 1)
|
||||
|
@ -220,7 +220,7 @@ class TestRing(TestRingBase):
|
||||
sleep(0.1)
|
||||
self.ring.get_nodes('a')
|
||||
self.assertEqual(len(self.ring.devs), 6)
|
||||
self.assertNotEquals(self.ring._mtime, orig_mtime)
|
||||
self.assertNotEqual(self.ring._mtime, orig_mtime)
|
||||
|
||||
os.utime(self.testgz, (time() - 300, time() - 300))
|
||||
self.ring = ring.Ring(self.testdir, reload_time=0.001,
|
||||
@ -236,7 +236,7 @@ class TestRing(TestRingBase):
|
||||
sleep(0.1)
|
||||
self.ring.get_part_nodes(0)
|
||||
self.assertEqual(len(self.ring.devs), 7)
|
||||
self.assertNotEquals(self.ring._mtime, orig_mtime)
|
||||
self.assertNotEqual(self.ring._mtime, orig_mtime)
|
||||
|
||||
os.utime(self.testgz, (time() - 300, time() - 300))
|
||||
self.ring = ring.Ring(self.testdir, reload_time=0.001,
|
||||
@ -253,7 +253,7 @@ class TestRing(TestRingBase):
|
||||
sleep(0.1)
|
||||
next(self.ring.get_more_nodes(part))
|
||||
self.assertEqual(len(self.ring.devs), 8)
|
||||
self.assertNotEquals(self.ring._mtime, orig_mtime)
|
||||
self.assertNotEqual(self.ring._mtime, orig_mtime)
|
||||
|
||||
os.utime(self.testgz, (time() - 300, time() - 300))
|
||||
self.ring = ring.Ring(self.testdir, reload_time=0.001,
|
||||
@ -268,7 +268,7 @@ class TestRing(TestRingBase):
|
||||
self.intended_devs, self.intended_part_shift).save(self.testgz)
|
||||
sleep(0.1)
|
||||
self.assertEqual(len(self.ring.devs), 9)
|
||||
self.assertNotEquals(self.ring._mtime, orig_mtime)
|
||||
self.assertNotEqual(self.ring._mtime, orig_mtime)
|
||||
|
||||
def test_reload_without_replication(self):
|
||||
replication_less_devs = [{'id': 0, 'region': 0, 'zone': 0,
|
||||
|
@ -830,7 +830,7 @@ class TestDatabaseBroker(unittest.TestCase):
|
||||
with broker.get() as conn:
|
||||
uuids = [r[0] for r in conn.execute('SELECT * FROM test_stat')]
|
||||
self.assertEqual(len(uuids), 1)
|
||||
self.assertNotEquals(uuids[0], uuid1)
|
||||
self.assertNotEqual(uuids[0], uuid1)
|
||||
uuid1 = uuids[0]
|
||||
points = [(r[0], r[1]) for r in conn.execute(
|
||||
'SELECT sync_point, '
|
||||
@ -845,7 +845,7 @@ class TestDatabaseBroker(unittest.TestCase):
|
||||
with broker.get() as conn:
|
||||
uuids = [r[0] for r in conn.execute('SELECT * FROM test_stat')]
|
||||
self.assertEqual(len(uuids), 1)
|
||||
self.assertNotEquals(uuids[0], uuid1)
|
||||
self.assertNotEqual(uuids[0], uuid1)
|
||||
uuid1 = uuids[0]
|
||||
points = [(r[0], r[1]) for r in conn.execute(
|
||||
'SELECT sync_point, '
|
||||
@ -856,7 +856,7 @@ class TestDatabaseBroker(unittest.TestCase):
|
||||
with broker.get() as conn:
|
||||
uuids = [r[0] for r in conn.execute('SELECT * FROM test_stat')]
|
||||
self.assertEqual(len(uuids), 1)
|
||||
self.assertNotEquals(uuids[0], uuid1)
|
||||
self.assertNotEqual(uuids[0], uuid1)
|
||||
points = [(r[0], r[1]) for r in conn.execute(
|
||||
'SELECT sync_point, '
|
||||
'remote_id FROM incoming_sync WHERE remote_id = ?', (uuid2,))]
|
||||
|
@ -315,7 +315,7 @@ class TestServer(unittest.TestCase):
|
||||
server2 = manager.Server('proxy-server')
|
||||
self.assertEqual(server1, server2)
|
||||
# it is NOT a string
|
||||
self.assertNotEquals(server1, 'proxy-server')
|
||||
self.assertNotEqual(server1, 'proxy-server')
|
||||
|
||||
def test_get_pid_file_name(self):
|
||||
server = manager.Server('proxy')
|
||||
|
@ -1865,7 +1865,7 @@ log_name = %(yarr)s'''
|
||||
isinstance(h, logging.StreamHandler)]
|
||||
self.assertEqual(len(console_handlers), 1)
|
||||
new_handler = console_handlers[0]
|
||||
self.assertNotEquals(new_handler, old_handler)
|
||||
self.assertNotEqual(new_handler, old_handler)
|
||||
|
||||
def verify_under_pseudo_time(
|
||||
self, func, target_runtime_ms=1, *args, **kwargs):
|
||||
@ -4251,7 +4251,7 @@ class TestThreadPool(unittest.TestCase):
|
||||
|
||||
my_id = self._thread_id()
|
||||
other_id = tp.run_in_thread(self._thread_id)
|
||||
self.assertNotEquals(my_id, other_id)
|
||||
self.assertNotEqual(my_id, other_id)
|
||||
|
||||
result = tp.run_in_thread(self._capture_args, 1, 2, bert='ernie')
|
||||
self.assertEqual(result, {'args': (1, 2),
|
||||
@ -4270,7 +4270,7 @@ class TestThreadPool(unittest.TestCase):
|
||||
|
||||
my_id = self._thread_id()
|
||||
other_id = tp.force_run_in_thread(self._thread_id)
|
||||
self.assertNotEquals(my_id, other_id)
|
||||
self.assertNotEqual(my_id, other_id)
|
||||
|
||||
result = tp.force_run_in_thread(self._capture_args, 1, 2, bert='ernie')
|
||||
self.assertEqual(result, {'args': (1, 2),
|
||||
@ -4298,7 +4298,7 @@ class TestThreadPool(unittest.TestCase):
|
||||
|
||||
my_id = self._thread_id()
|
||||
other_id = tp.force_run_in_thread(self._thread_id)
|
||||
self.assertNotEquals(my_id, other_id)
|
||||
self.assertNotEqual(my_id, other_id)
|
||||
|
||||
result = tp.force_run_in_thread(self._capture_args, 1, 2, bert='ernie')
|
||||
self.assertEqual(result, {'args': (1, 2),
|
||||
|
@ -1191,7 +1191,7 @@ class TestContainerBroker(unittest.TestCase):
|
||||
broker.initialize(Timestamp('1').internal, 0)
|
||||
id = broker.get_info()['id']
|
||||
broker.newid('someid')
|
||||
self.assertNotEquals(id, broker.get_info()['id'])
|
||||
self.assertNotEqual(id, broker.get_info()['id'])
|
||||
|
||||
def test_get_items_since(self):
|
||||
# test DatabaseBroker.get_items_since
|
||||
|
@ -3496,7 +3496,7 @@ class TestObjectController(unittest.TestCase):
|
||||
headers=headers)
|
||||
self.app.update_request(req)
|
||||
req.get_response(self.app)
|
||||
self.assertNotEquals(it_worked, [])
|
||||
self.assertNotEqual(it_worked, [])
|
||||
self.assertTrue(all(it_worked))
|
||||
|
||||
def test_PUT_autodetect_content_type(self):
|
||||
@ -3518,7 +3518,7 @@ class TestObjectController(unittest.TestCase):
|
||||
headers=headers)
|
||||
self.app.update_request(req)
|
||||
req.get_response(self.app)
|
||||
self.assertNotEquals(it_worked, [])
|
||||
self.assertNotEqual(it_worked, [])
|
||||
self.assertTrue(all(it_worked))
|
||||
|
||||
def test_client_timeout(self):
|
||||
@ -8882,7 +8882,7 @@ class TestSwiftInfo(unittest.TestCase):
|
||||
sorted_pols = sorted(si['policies'], key=operator.itemgetter('name'))
|
||||
self.assertEqual(len(sorted_pols), 3)
|
||||
for policy in sorted_pols:
|
||||
self.assertNotEquals(policy['name'], 'deprecated')
|
||||
self.assertNotEqual(policy['name'], 'deprecated')
|
||||
self.assertEqual(sorted_pols[0]['name'], 'bert')
|
||||
self.assertEqual(sorted_pols[1]['name'], 'ernie')
|
||||
self.assertEqual(sorted_pols[2]['name'], 'migrated')
|
||||
|
Loading…
Reference in New Issue
Block a user