1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-07-17 12:33:28 +01:00

Unit tests

This commit is contained in:
Sebastian Goscik
2016-06-30 17:29:30 +01:00
parent 02138c60cc
commit e258999e0a
6 changed files with 545 additions and 40 deletions

@ -21,7 +21,7 @@ from nose.tools import raises, assert_equal, assert_not_equal # pylint: disable
from wlauto.utils.android import check_output
from wlauto.utils.misc import merge_dicts, merge_lists, TimeoutError
from wlauto.utils.types import list_or_integer, list_or_bool, caseless_string, arguments, enable_disable_list
from wlauto.utils.types import list_or_integer, list_or_bool, caseless_string, arguments, toggle_set
class TestCheckOutput(TestCase):
@ -89,10 +89,10 @@ class TestTypes(TestCase):
['--foo', '7', '--bar', 'fizz buzz'])
assert_equal(arguments(['test', 42]), ['test', '42'])
def enable_disable_list_test():
def toggle_set_test():
a = enable_disable_list(['qaz', 'qwert', 'asd', '~fgh', '~seb'])
b = enable_disable_list(['qaz', 'xyz', '~asd', 'fgh', '~seb'])
a = toggle_set(['qaz', 'qwert', 'asd', '~fgh', '~seb'])
b = toggle_set(['qaz', 'xyz', '~asd', 'fgh', '~seb'])
a_into_b = ['qaz', 'xyz', '~seb', 'qwert', 'asd', '~fgh']
assert_equal(a.merge_into(b), a_into_b)
@ -104,3 +104,6 @@ class TestTypes(TestCase):
assert_equal(a.values(), ['qaz', 'qwert', 'asd'])
assert_equal(b.merge_with(a).values(), ['qaz', 'xyz', 'qwert', 'asd'])
assert_equal(a.values(), ['qaz', 'qwert', 'asd'])
assert_equal(a.conflicts_with(b), ['~asd', '~fgh'])