def test_prereqs(self): # dbi = FakeDataBaseInterface(3) a = sch.Action(1, 'UV', ['UV', 'UV'], 0, self.wf) # Jon : HARDWF # a = sch.Action(self.files[1], self.task, ['UV', None], self.still, self.wf) # Jon : Fixme HARDWF self.assertTrue(a.has_prerequisites()) a = sch.Action(1, 'ACQUIRE_NEIGHBORS', ['UVCR', 'UVCR'], 0, self.wf) # Jon : HARDWF self.assertTrue(a.has_prerequisites()) a = sch.Action(1, 'ACQUIRE_NEIGHBORS', ['UVCR', 'UV'], 0, self.wf) # Jon : HARDWF self.assertFalse(a.has_prerequisites())
def test_action_cmp(self): priorities = range(10) # def __init__(self, obs, task, neighbor_status, still, workflow, task_clients=[], timeout=3600.): actions = [sch.Action(self.files[1], self.task, [self.files[0], self.files[2]], self.still, self.wf) for p in priorities] random.shuffle(priorities) for a, p in zip(actions, priorities): a.set_priority(p) actions.sort(cmp=sch.action_cmp) for cnt, a in enumerate(actions): self.assertEqual(a.priority, cnt)
def test_prereqs(self): a = sch.Action(self.files[1], self.task, ['UV', None], self.still, self.wf) # Jon : Fixme HARDWF self.assertTrue(a.has_prerequisites())
def test_priority(self): a = sch.Action(self.files[1], self.task, [self.files[0], self.files[2]], self.still, self.wf) self.assertEqual(a.priority, 0) a.set_priority(5) self.assertEqual(a.priority, 5)
def test_attributes(self): a = sch.Action(self.files[1], self.task, [self.files[0], self.files[2]], self.still, self.wf) self.assertEqual(a.task, self.task)