test_sathandlers.py 文件源码

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

项目:Python-iBeacon-Scan 作者: NikNitro 项目源码 文件源码
def test_CheckOldAssump():
    # TODO: Make these tests more complete

    class Test1(Expr):
        def _eval_is_positive(self):
            return True
        def _eval_is_negative(self):
            return False

    class Test2(Expr):
        def _eval_is_finite(self):
            return True
        def _eval_is_positive(self):
            return True
        def _eval_is_negative(self):
            return False

    t1 = Test1()
    t2 = Test2()

    # We can't say if it's positive or negative in the old assumptions without
    # bounded. Remember, True means "no new knowledge", and
    # Q.positive(t2) means "t2 is positive."
    assert CheckOldAssump(Q.positive(t1)) == True
    assert CheckOldAssump(Q.negative(t1)) == ~Q.negative(t1)

    assert CheckOldAssump(Q.positive(t2)) == Q.positive(t2)
    assert CheckOldAssump(Q.negative(t2)) == ~Q.negative(t2)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号