aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwiktor w brodlo <wiktor@brodlo.net>2011-06-15 16:59:54 +0000
committerwiktor w brodlo <wiktor@brodlo.net>2011-06-15 16:59:54 +0000
commit2590d96369d0217e31dc2812690dde61dac417b5 (patch)
tree82276f787b08a28548e342c7921486f1acefab9f /tests/__init__.py
parentfirst commit (diff)
downloadanaconda-2590d96369d0217e31dc2812690dde61dac417b5.tar.gz
anaconda-2590d96369d0217e31dc2812690dde61dac417b5.tar.bz2
anaconda-2590d96369d0217e31dc2812690dde61dac417b5.zip
Initial import from Sabayon (ver 0.9.9.56)
Diffstat (limited to 'tests/__init__.py')
-rw-r--r--tests/__init__.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/__init__.py b/tests/__init__.py
new file mode 100644
index 0000000..d5b53a8
--- /dev/null
+++ b/tests/__init__.py
@@ -0,0 +1,29 @@
+import os
+
+# this has to be imported before running anything
+import anaconda_log
+import upgrade
+
+
+def getAvailableSuites():
+ root, tests_dir = os.path.split(os.path.dirname(__file__))
+ modules = []
+
+ for root, dirs, files in os.walk(tests_dir):
+ for filename in files:
+ if filename.endswith(".py") and filename != "__init__.py":
+ basename, extension = os.path.splitext(filename)
+ modules.append(os.path.join(root, basename).replace("/", "."))
+
+ available_suites = {}
+ for module in modules:
+ imported = __import__(module, globals(), locals(), [module], -1)
+ try:
+ suite = getattr(imported, "suite")
+ except AttributeError as e:
+ continue
+
+ if callable(suite):
+ available_suites[module] = suite()
+
+ return available_suites