X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=t%2Fmoe%2Fexts%2Fdummy.py;h=3ec5816565644b6a8f6c053f61875d5e58c93fa2;hb=878693c0f1a0a4cee1ae0478e762b4c57dc44df3;hp=eef59bd5503eadef3f839ab21a344a5ad9763d55;hpb=8cbb26f1dd4ed67eaf4b1edb877723a78a3368af;p=moe.git diff --git a/t/moe/exts/dummy.py b/t/moe/exts/dummy.py index eef59bd..3ec5816 100644 --- a/t/moe/exts/dummy.py +++ b/t/moe/exts/dummy.py @@ -7,16 +7,19 @@ Adds several info-printing hooks to both pipelines. def init(e): - def hook_m_0: - e.log.info('Hey! It\'s me, the dummy extension in your main pipeline! (at time 0)') - e.main_pipeline.insert(hook_m_0, 'exts.dummy.hook_m_0', 0) - - def hook_m_79: - e.log.info('Me, the dummy extension, requies no cleanup! (at time 79)') - e.main_pipeline.insert(hook_m_79, 'exts.dummy.hook_m_79', 79) - - def hook_t_42: - t = 'It\'s test %s and the dummy extension did nothing! (at time 42)' % e['TEST'] - e.log.info(t) - e.log.user.info(t) - e.test_pipeline.insert(hook_t_42, 'exts.dummy.hook_t_42', 42) + def hook_m_0(e): + e.log.info('Hey! It\'s me, the dummy extension in your main pipeline! (at time 0)') + + e.main_pipe.insert(0, 'exts.dummy.hook_m_0', hook_m_0) + + def hook_m_79(e): + e.log.info('Me, the dummy extension, requies no cleanup! (at time 79)') + + e.main_pipe.insert(79, 'exts.dummy.hook_m_79', hook_m_79) + + def hook_t_42(e): + t = 'It\'s test %s and the dummy extension did nothing! (at time 42)' % e['TEST'] + e.log.info(t) + e.log.user.info(t) + + e.test_pipe.insert(42, 'exts.dummy.hook_t_42', hook_t_42)