def test_no_matcher(self): ex = Expectation(deferred=True) ex = ex.less_than(1).Or(3) ex.resolve(2) ex = ex.less_than(1).And(3) ex.resolve(0)
def test_negation(self): ex = Expectation(deferred=True) ex = ex.not_equal(3) ex.resolve(0) ex = ex.NOT_equal(3) self.assertRaises(AssertionError, lambda: ex.resolve(3)) ex = ex.not_equal(3).and_not_equal(0) ex.resolve(1) ex = ex.not_equal(3).and_Not_equal(0) self.assertRaises(AssertionError, lambda: ex.resolve(0)) ex = ex.not_equal(3).and_Not_equal(0) self.assertRaises(AssertionError, lambda: ex.resolve(3)) ex = ex.less_than(3).but_not_equal(2) ex.resolve(1) ex = ex.less_than(3).But_Not_equal(2) self.assertRaises(AssertionError, lambda: ex.resolve(2))
def test_implicit_and(self): ex = Expectation(deferred=True) ex.less_than(1).less_than(2) ex.resolve(0) ex.less_than(1).less_than(2) self.assertRaises(AssertionError, lambda: ex.resolve(1)) ex.less_than(2).less_than(1) self.assertRaises(AssertionError, lambda: ex.resolve(1))