class Integral(MatcherTestCase): test_none = lambda self: self.assert_no_match(None) test_object = lambda self: self.assert_no_match(object()) test_iterable = lambda self: self.assert_no_match([]) test_integer = lambda self: self.assert_match(0) @skipIf(IS_PY3, "requires Python 2.x") def test_long(self): self.assert_match(eval('0l')) test_fraction = lambda self: self.assert_no_match(Fraction(7, 9)) test_float = lambda self: self.assert_no_match(0.0) test_complex = lambda self: self.assert_no_match(complex(0, 1)) test_repr = lambda self: self.assert_repr(__unit__.Integral()) # Assertion functions def assert_match(self, value): return super(Integral, self).assert_match(__unit__.Integral(), value) def assert_no_match(self, value): return super(Integral, self) \ .assert_no_match(__unit__.Integral(), value)
def assert_no_match(self, value): return super(Integral, self) \ .assert_no_match(__unit__.Integral(), value)