summaryrefslogtreecommitdiffstats
path: root/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/utils.py b/utils.py
index 1ba7137..1a222c8 100644
--- a/utils.py
+++ b/utils.py
@@ -1,4 +1,5 @@
#!/usr/bin/python2
+import collections
def get_os_name(name):
try: return name.split(' ')[0].lower()
@@ -7,8 +8,16 @@ def get_os_name(name):
def select_with_attribute(iterable, attribute, result=True):
return [value for value in iterable if (attribute in value) == result]
+def is_iterable(obj):
+ if isinstance(obj, collections.Iterable):
+ return True
+ return False
filters = [
('select_with_attribute', select_with_attribute),
('get_os_name', get_os_name)
]
+
+tests = [
+ ('iterable', is_iterable)
+]