]> mj.ucw.cz Git - eval.git/blobdiff - t/moe/tasktypes/dummy.py
Added ConfigTree.remove, adapted parse and parse_file
[eval.git] / t / moe / tasktypes / dummy.py
index 20e358414b9e1fe7c5492b7ec21c8a235006a77f..7f06418e2bde57b8aa50c3cc93ae813f7e3b498f 100644 (file)
@@ -6,30 +6,32 @@ Adds several info-printing hooks to both pipelines.
 Runs the test pipeline for each TEST
 """
 
+import moe.config
+
 def init(e):
       
-    def hook_m_50(self):
+    def hook_m_50(e):
        e.log.info('Here should be compiling')
 
-    e.main_pipe.insert(hook_m_50, 'dummy tasktype hook_m_50', 50)
+    e.main_pipe.insert(50, 'dummy tasktype hook_m_50', hook_m_50)
     
-    def hook_m_60(self):
-       e.log.info('Here should be test pipeline running')
+    def hook_m_60(e):
+       e.log.info('Here we run test pipeline')
        tests = e['TESTS'].split()
        for t in tests:
             e.log.info('Running test %s' % t)
             e.log.user.info('TEST %s ...' % t)
 
-            op = moe.config.Operation('SET', None, t, level=70, source='<dummy tasktype>')
+            op = moe.config.Operation('SET', None, moe.config.ConfigExpression([t]), level=70, source='<dummy tasktype>')
             testvar = e.config.lookup('TEST')
             # Add and remove operation setting 'TEST="..."'
             testvar.add_operation(op)
-            e.test_pipeline.run()
+            e.test_pipe.run(e=e)
             testvar.remove_operation(op)
     
-    e.main_pipe.insert(hook_m_60, 'dummy tasktype hook_m_60', 60) 
+    e.main_pipe.insert(60, 'dummy tasktype hook_m_60', hook_m_60) 
     
-    def hook_t_30(self):
+    def hook_t_30(e):
        e.log.info("Maybe we should do something? Nah...")
     
-    e.test_pipe.insert(hook_t_30, 'dummy tasktype hook_t_30', 30) 
+    e.test_pipe.insert(30, 'dummy tasktype hook_t_30', hook_t_30)