summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkshithijiyer <kshithij.ki@gmail.com>2020-01-18 20:17:11 +0530
committerKshithij Iyer <kiyer@redhat.com>2020-01-20 08:20:35 +0000
commit85b1c8a2cb07071bcfd1ed1405ba9e7d5d66e483 (patch)
tree9dfd6801560322789da6fe00499e038f2b3cc51a
parentd3108a62a61fd01140193c36f57980be97defa95 (diff)
[TestFix] Optimize repeated dictionary access using loop
Change-Id: I332a66659b5abefb5d5052232ec9b61124860575 Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
-rw-r--r--tests/functional/heketi/test_heketi_device_operations.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/functional/heketi/test_heketi_device_operations.py b/tests/functional/heketi/test_heketi_device_operations.py
index fb9be30..b4987ba 100644
--- a/tests/functional/heketi/test_heketi_device_operations.py
+++ b/tests/functional/heketi/test_heketi_device_operations.py
@@ -505,9 +505,8 @@ class TestHeketiDeviceOperations(BaseClass):
for key in ('id', 'name', 'state', 'storage', 'bricks'):
self.assertIn(key, list(device_from_t_info.keys()))
self.assertIn(key, list(device_info.keys()))
- self.assertEqual(device_info['id'], device_from_t_info['id'])
- self.assertEqual(device_info['name'], device_from_t_info['name'])
- self.assertEqual(device_info['state'], device_from_t_info['state'])
+ for key in ('id', 'name', 'state'):
+ self.assertEqual(device_info[key], device_from_t_info[key])
device_info_storage = device_info['storage']
device_from_t_info_storage = device_from_t_info['storage']
device_info_storage_keys = list(device_info_storage.keys())