Home
last modified time | relevance | path

Searched refs:mock_method (Results 1 – 6 of 6) sorted by relevance

/external/python/cpython3/Lib/unittest/test/testmock/
Dtestasync.py59 def test_async(mock_method): argument
60 self.assertTrue(iscoroutinefunction(mock_method))
65 def test_async(mock_method): argument
66 m = mock_method()
71 def test_no_parent_attribute(mock_method): argument
72 m = mock_method()
81 def test_async(mock_method): argument
82 self.assertIsInstance(mock_method, AsyncMock)
88 def test_async(mock_method): argument
89 self.assertIsInstance(mock_method, AsyncMock)
[all …]
Dtestmock.py1593 mock_method = mock.create_autospec(getattr(TestClass, method))
1594 mock_method()
1595 mock_method.assert_called_once_with()
1596 self.assertRaises(TypeError, mock_method, 'extra_arg')
/external/protobuf/python/
Dmox.py500 mock_method = self._CreateMockMethod('__call__')
501 return mock_method(*params, **named_params)
1194 def AddMethod(self, mock_method): argument
1197 def MethodCalled(self, mock_method): argument
1214 def AddMethod(self, mock_method): argument
1221 self._methods.append(mock_method)
1223 def MethodCalled(self, mock_method): argument
1242 if method == mock_method:
1247 self._methods.remove(mock_method)
1251 mock_method._call_queue.appendleft(self)
[all …]
/external/python/mock/mock/tests/
Dtestmock.py1513 mock_method = mock.create_autospec(getattr(TestClass, method))
1514 mock_method()
1515 mock_method.assert_called_once_with()
1516 self.assertRaises(TypeError, mock_method, 'extra_arg')
/external/python/cpython3/Doc/library/
Dunittest.mock-examples.rst441 ... def test_something(self, mock_method):
443 ... mock_method.assert_called_with()
483 >>> with patch.object(ProductionClass, 'method') as mock_method:
484 ... mock_method.return_value = None
488 >>> mock_method.assert_called_with(1, 2, 3)
Dunittest.mock.rst128 >>> with patch.object(ProductionClass, 'method', return_value=None) as mock_method:
132 >>> mock_method.assert_called_once_with(1, 2, 3)
1560 ... def test(mock_method):
1562 ... mock_method.assert_called_with(3)