test_information.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:sldc 作者: waliens 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号