def testErrors(self):
p1, p2 = Point(0, 0), Point(1, 0)
timing = WorkflowTiming()
with self.assertRaises(ValueError):
WorkflowInformation([p1, p2], [1], timing)
with self.assertRaises(ValueError):
WorkflowInformation([p1, p2], [1, 2], timing, others=([2], "other"))
with self.assertRaises(ValueError):
WorkflowInformation([p1, p2], [1, 2], timing, __init__=([1, 2], "__init__s"))
first = WorkflowInformation([p1, p2], [1, 2], timing, others=([2, 1], "other"))
second = WorkflowInformation([p1, p2], [1, 2], timing)
third = WorkflowInformation([p1, p2], [1, 2], timing, others=([2, 1], "oo"))
with self.assertRaises(TypeError):
first._is_compatible(dict())
with self.assertRaises(ValueError):
first._is_compatible(second)
with self.assertRaises(ValueError):
first._is_compatible(third)
评论列表
文章目录