Ejemplo n.º 1
0
 def test_mismatch_passes_through_to_callable_builtin(self):
     self.patch(matchers, "callable").return_value = False
     result = IsCallable().match(sentinel.function)
     matchers.callable.assert_called_once_with(sentinel.function)
     self.assertIsInstance(result, Mismatch)
     self.assertEqual("%r is not callable" % sentinel.function,
                      result.describe())
Ejemplo n.º 2
0
 def test_mismatch_passes_through_to_callable_builtin(self):
     self.patch(matchers, "callable").return_value = False
     result = IsCallable().match(sentinel.function)
     matchers.callable.assert_called_once_with(sentinel.function)
     self.assertIsInstance(result, Mismatch)
     self.assertEqual(
         "%r is not callable" % sentinel.function,
         result.describe())
Ejemplo n.º 3
0
 def test_returns_mismatch_when_matchee_is_callable(self):
     result = IsCallable().match(1234)
     self.assertIsInstance(result, Mismatch)
     self.assertEqual("1234 is not callable", result.describe())
Ejemplo n.º 4
0
 def test_returns_mismatch_when_matchee_is_callable(self):
     result = IsCallable().match(1234)
     self.assertIsInstance(result, Mismatch)
     self.assertEqual(
         "1234 is not callable",
         result.describe())