aboutsummaryrefslogtreecommitdiff
path: root/lava_scheduler_app/tests/test_pipeline.py
diff options
context:
space:
mode:
authorStevan Radakovic <stevan.radakovic@linaro.org>2017-12-14 08:43:15 +0100
committerNeil Williams <neil.williams@linaro.org>2017-12-18 11:41:51 +0000
commit70cb792c77038e6de0897e122477d7c0413253b0 (patch)
tree6e5d8de67c7d611226edad343f3e0431177280b9 /lava_scheduler_app/tests/test_pipeline.py
parent2d427a84f649e46cd4bd675b1ab87c530737dae0 (diff)
LAVA-963 - Support python3 -Wall unit tests
Support running the unit tests with python3 without error or fails. Update various code bits to support both versions of python. Change-Id: Ia62845dd7b480731526f3b54867701aa95dcdba8
Diffstat (limited to 'lava_scheduler_app/tests/test_pipeline.py')
-rw-r--r--lava_scheduler_app/tests/test_pipeline.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/lava_scheduler_app/tests/test_pipeline.py b/lava_scheduler_app/tests/test_pipeline.py
index faf7814db..b5c00e5e7 100644
--- a/lava_scheduler_app/tests/test_pipeline.py
+++ b/lava_scheduler_app/tests/test_pipeline.py
@@ -469,7 +469,7 @@ class TestPipelineSubmit(TestCaseWithFactory):
boot_params = None
for name, params in ((x, d[x])
- for x, d in ((d.keys()[0], d)
+ for x, d in ((list(d.keys())[0], d)
for d in data['actions'])):
if name == 'boot':
boot_params = params
@@ -840,8 +840,8 @@ class TestYamlMultinode(TestCaseWithFactory):
self.assertEqual(len(jobs), 2)
for role, job_list in jobs.items():
for job in job_list:
+ del(job['protocols']['lava-multinode']['sub_id'])
yaml.dump(job) # ensure the jobs can be serialised as YAML
- role = job['protocols']['lava-multinode']['role']
if role == 'client':
self.assertEqual(job, yaml.load(open(client_check, 'r')))
if role == 'server':
@@ -944,7 +944,7 @@ class TestYamlMultinode(TestCaseWithFactory):
'security_mirror': 'http://mirror.csclub.uwaterloo.ca/debian-security/', 'release': 'sid',
'distribution': 'debian', 'mirror': 'http://ftp.us.debian.org/debian/'}
}
- for role, _ in jobs.iteritems():
+ for role, _ in jobs.items():
if role == 'server':
self.assertNotIn('lava-lxc', jobs[role][0]['protocols'])
elif role == 'client':
@@ -970,7 +970,7 @@ class TestYamlMultinode(TestCaseWithFactory):
'distribution': 'debian', 'mirror': 'http://mirror.bytemark.co.uk/debian',
'name': 'lxc-hikey-oe', 'release': 'jessie', 'template': 'debian'}
}
- for role, _ in jobs.iteritems():
+ for role, _ in jobs.items():
if role == 'server':
self.assertIn('lava-lxc', jobs[role][0]['protocols'])
self.assertEqual(jobs[role][0]['protocols']['lava-lxc'], server_protocol_data['lava-lxc'])
@@ -1432,11 +1432,11 @@ class VlanInterfaces(TestCaseWithFactory):
submission = yaml.load(open(self.filename, 'r'))
self.assertIn('protocols', submission)
self.assertIn('lava-vland', submission['protocols'])
- roles = [role for role, _ in submission['protocols']['lava-vland'].iteritems()]
+ roles = [role for role, _ in submission['protocols']['lava-vland'].items()]
params = submission['protocols']['lava-vland']
vlans = {}
for role in roles:
- for name, tags in params[role].iteritems():
+ for name, tags in params[role].items():
vlans[name] = tags
self.assertIn('vlan_one', vlans)
self.assertIn('vlan_two', vlans)