diff options
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oeqa/core/utils/misc.py | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/meta/lib/oeqa/core/utils/misc.py b/meta/lib/oeqa/core/utils/misc.py deleted file mode 100644 index e1a59588eb..0000000000 --- a/meta/lib/oeqa/core/utils/misc.py +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | # | ||
2 | # Copyright (C) 2016 Intel Corporation | ||
3 | # | ||
4 | # SPDX-License-Identifier: MIT | ||
5 | # | ||
6 | |||
7 | def toList(obj, obj_type, obj_name="Object"): | ||
8 | if isinstance(obj, obj_type): | ||
9 | return [obj] | ||
10 | elif isinstance(obj, list): | ||
11 | return obj | ||
12 | else: | ||
13 | raise TypeError("%s must be %s or list" % (obj_name, obj_type)) | ||
14 | |||
15 | def toSet(obj, obj_type, obj_name="Object"): | ||
16 | if isinstance(obj, obj_type): | ||
17 | return {obj} | ||
18 | elif isinstance(obj, list): | ||
19 | return set(obj) | ||
20 | elif isinstance(obj, set): | ||
21 | return obj | ||
22 | else: | ||
23 | raise TypeError("%s must be %s or set" % (obj_name, obj_type)) | ||
24 | |||
25 | def strToList(obj, obj_name="Object"): | ||
26 | return toList(obj, str, obj_name) | ||
27 | |||
28 | def strToSet(obj, obj_name="Object"): | ||
29 | return toSet(obj, str, obj_name) | ||
30 | |||
31 | def intToList(obj, obj_name="Object"): | ||
32 | return toList(obj, int, obj_name) | ||
33 | |||
34 | def dataStoteToDict(d, variables): | ||
35 | data = {} | ||
36 | |||
37 | for v in variables: | ||
38 | data[v] = d.getVar(v) | ||
39 | |||
40 | return data | ||
41 | |||
42 | def updateTestData(d, td, variables): | ||
43 | """ | ||
44 | Updates variables with values of data store to test data. | ||
45 | """ | ||
46 | for var in variables: | ||
47 | td[var] = d.getVar(var) | ||