def test__returns_mismatch_when_its_a_non_callable_object(self): matcher = IsCallableMock() result = matcher.match(object()) self.assertMismatch(result, " is not callable")
def test__returns_mismatch_when_its_a_non_callable_autospec(self): mock = create_autospec(None) matcher = IsCallableMock() result = matcher.match(mock) self.assertMismatch(result, " is not callable")
def test__returns_none_when_its_a_callable_autospec(self): mock = create_autospec(lambda: None) matcher = IsCallableMock() result = matcher.match(mock) self.assertIsNone(result)
def test__returns_mismatch_when_its_a_non_callable_mock(self): mock = NonCallableMock() matcher = IsCallableMock() result = matcher.match(mock) self.assertMismatch(result, " is not callable")
def test__returns_none_when_its_a_callable_mock(self): mock = Mock() matcher = IsCallableMock() result = matcher.match(mock) self.assertIsNone(result)