mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-04-15 23:30:47 +01:00
tests: Update tests to work with python3
This commit is contained in:
parent
107fdc203c
commit
57ddf7845c
@ -127,7 +127,7 @@ class AgendaTest(TestCase):
|
|||||||
def test_duplicate_id(self):
|
def test_duplicate_id(self):
|
||||||
try:
|
try:
|
||||||
self.parser.load(self.config, duplicate_agenda, 'test')
|
self.parser.load(self.config, duplicate_agenda, 'test')
|
||||||
except ConfigError, e:
|
except ConfigError as e:
|
||||||
assert_in('duplicate', e.message.lower()) # pylint: disable=E1101
|
assert_in('duplicate', e.message.lower()) # pylint: disable=E1101
|
||||||
else:
|
else:
|
||||||
raise Exception('ConfigError was not raised for an agenda with duplicate ids.')
|
raise Exception('ConfigError was not raised for an agenda with duplicate ids.')
|
||||||
@ -135,7 +135,7 @@ class AgendaTest(TestCase):
|
|||||||
def test_yaml_missing_field(self):
|
def test_yaml_missing_field(self):
|
||||||
try:
|
try:
|
||||||
self.parser.load(self.config, invalid_agenda, 'test')
|
self.parser.load(self.config, invalid_agenda, 'test')
|
||||||
except ConfigError, e:
|
except ConfigError as e:
|
||||||
assert_in('workload name', e.message)
|
assert_in('workload name', e.message)
|
||||||
else:
|
else:
|
||||||
raise Exception('ConfigError was not raised for an invalid agenda.')
|
raise Exception('ConfigError was not raised for an invalid agenda.')
|
||||||
|
@ -38,7 +38,7 @@ class TestPriorityList(TestCase):
|
|||||||
for key in elements:
|
for key in elements:
|
||||||
pl.add(elements[key], priority=key)
|
pl.add(elements[key], priority=key)
|
||||||
|
|
||||||
match = zip(sorted(elements.values()), pl[:])
|
match = list(zip(sorted(elements.values()), pl[:]))
|
||||||
for pair in match:
|
for pair in match:
|
||||||
assert(pair[0] == pair[1])
|
assert(pair[0] == pair[1])
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ class TestPriorityList(TestCase):
|
|||||||
pl.add(elements[key], priority=key)
|
pl.add(elements[key], priority=key)
|
||||||
del elements[2]
|
del elements[2]
|
||||||
del pl[2]
|
del pl[2]
|
||||||
match = zip(sorted(elements.values()), pl[:])
|
match = list(zip(sorted(elements.values()), pl[:]))
|
||||||
for pair in match:
|
for pair in match:
|
||||||
assert(pair[0] == pair[1])
|
assert(pair[0] == pair[1])
|
||||||
|
|
||||||
@ -65,10 +65,10 @@ class TestPriorityList(TestCase):
|
|||||||
pl.add('3', 3)
|
pl.add('3', 3)
|
||||||
pl.add('2.2', 2)
|
pl.add('2.2', 2)
|
||||||
it = iter(pl)
|
it = iter(pl)
|
||||||
assert_equal(it.next(), '3')
|
assert_equal(next(it), '3')
|
||||||
assert_equal(it.next(), '2.1')
|
assert_equal(next(it), '2.1')
|
||||||
assert_equal(it.next(), '2.2')
|
assert_equal(next(it), '2.2')
|
||||||
assert_equal(it.next(), '1')
|
assert_equal(next(it), '1')
|
||||||
|
|
||||||
def test_iterator_break(self):
|
def test_iterator_break(self):
|
||||||
pl = prioritylist()
|
pl = prioritylist()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user