diff talosnames/api.py @ 17:25e91fc7ff01

getting the test config now works
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 10 Jul 2012 18:23:16 -0700
parents 1713b3e244a7
children 48b4c926be73
line wrap: on
line diff
--- a/talosnames/api.py	Tue Jul 10 18:18:42 2012 -0700
+++ b/talosnames/api.py	Tue Jul 10 18:23:16 2012 -0700
@@ -41,6 +41,7 @@
         self.setup_database()
         self.tbpl_mapping()
         self.setup_buildbot()
+        self._talos_configs = {}
 
     def setup_database(self):
         self.db = sqlite3.connect(':memory:')
@@ -113,6 +114,15 @@
         call(['PerfConfigurator'] + command, stdout=subprocess.PIPE, cwd=talos_dir)
         assert os.path.exists(outfile)
         config = yaml.load(file(outfile))
+        return config
+
+    def test_config(self, name):
+        test_config = self.talos_config(name)['tests']
+        retval = {}
+        for test in test_config:
+            name = test.pop('name')
+            retval[name] = test
+        return retval
 
     def __call__(self, name=None):
         retval = []