diff options
| author | Naveed Massjouni <naveedm9@gmail.com> | 2011-02-18 02:23:30 -0500 |
|---|---|---|
| committer | Naveed Massjouni <naveedm9@gmail.com> | 2011-02-18 02:23:30 -0500 |
| commit | 4673afddcb5a1069f75fb3493e43498ed1de11f9 (patch) | |
| tree | ca612022e176b724d784b2028af2275b90856757 /nova | |
| parent | 841b02230866cc163c26a264e86bba94c4b0335d (diff) | |
| download | nova-4673afddcb5a1069f75fb3493e43498ed1de11f9.tar.gz nova-4673afddcb5a1069f75fb3493e43498ed1de11f9.tar.xz nova-4673afddcb5a1069f75fb3493e43498ed1de11f9.zip | |
Incorporating minor cleanups suggested by Rick Harris:
* Use assertNotEqual instead of assertTrue
* Use enumerate function instead of maintaining a counter
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/tests/api/openstack/test_servers.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/nova/tests/api/openstack/test_servers.py b/nova/tests/api/openstack/test_servers.py index 630e1e5eb..4ed13022b 100644 --- a/nova/tests/api/openstack/test_servers.py +++ b/nova/tests/api/openstack/test_servers.py @@ -259,15 +259,13 @@ class ServersTest(unittest.TestCase): server_list = res_dict['servers'] host_ids = [server_list[0]['hostId'], server_list[1]['hostId']] self.assertTrue(host_ids[0] and host_ids[1]) - self.assertTrue(host_ids[0] != host_ids[1]) + self.assertNotEqual(host_ids[0], host_ids[1]) - i = 0 - for s in res_dict['servers']: + for i, s in enumerate(res_dict['servers']): self.assertEqual(s['id'], i) self.assertEqual(s['hostId'], host_ids[i % 2]) self.assertEqual(s['name'], 'server%d' % i) self.assertEqual(s['imageId'], 10) - i += 1 def test_server_pause(self): FLAGS.allow_admin_api = True |
