def test_ensemble_db(self): self.assertEquals(len(ensembles.list_ensembles(self.user_id)), 0, "Should be no ensembles") e = ensembles.create_ensemble(self.user_id, "foo", 1, 1) self.assertEquals(len(ensembles.list_ensembles(self.user_id)), 1, "Should be 1 ensemble") self.assertEquals(len(ensembles.list_actionable_ensembles()), 0, "Should be 0 actionable ensembles") w = ensembles.EnsembleWorkflow(e.id, "bar") db.session.add(w) db.session.flush() self.assertEquals(len(ensembles.list_actionable_ensembles()), 1, "Should be 1 actionable ensembles")
def loop_once(self): for e in ensembles.list_actionable_ensembles(): log.info("Processing ensemble %s" % e.name) p = self.Processor(e) p.run()