mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-07-12 01:53:32 +01:00
list_or: chaniging how list_or_* functions work and adding a generic list_or
list_or_* functions (e.g. list_or_string) will now always return a list, however will accept lists or indivitual values. Also added a list_or() generator function, similar to what already exists for list_of().
This commit is contained in:
wlauto
instrumentation
tests
utils
workloads
spec2000
@ -21,6 +21,7 @@ from nose.tools import raises, assert_equal # pylint: disable=E0611
|
||||
|
||||
from wlauto.utils.android import check_output
|
||||
from wlauto.utils.misc import merge_dicts, TimeoutError
|
||||
from wlauto.utils.types import list_or_integer, list_or_bool
|
||||
|
||||
|
||||
class TestCheckOutput(TestCase):
|
||||
@ -61,3 +62,11 @@ class TestMerge(TestCase):
|
||||
other = {'a': 'test'}
|
||||
merge_dicts(base, other, match_types=True)
|
||||
|
||||
|
||||
class TestTypes(TestCase):
|
||||
|
||||
def test_list_or_conversion(self):
|
||||
assert_equal(list_or_integer([1, '2', 3]), [1, 2, 3])
|
||||
assert_equal(list_or_integer('0xF'), [15,])
|
||||
assert_equal(list_or_bool('False'), [False,])
|
||||
|
||||
|
Reference in New Issue
Block a user