Lines Matching refs:mock_method

56         def test_async(mock_method):  argument
57 self.assertTrue(asyncio.iscoroutinefunction(mock_method))
62 def test_async(mock_method): argument
63 m = mock_method()
68 def test_no_parent_attribute(mock_method): argument
69 m = mock_method()
78 def test_async(mock_method): argument
79 self.assertIsInstance(mock_method, AsyncMock)
85 def test_async(mock_method): argument
86 self.assertIsInstance(mock_method, AsyncMock)
92 def test_async(mock_method): argument
93 self.assertIsInstance(mock_method, AsyncMock)
117 with patch.object(AsyncClass, 'async_method') as mock_method:
118 self.assertTrue(asyncio.iscoroutinefunction(mock_method))
124 with patch.object(AsyncClass, 'async_method') as mock_method:
125 m = mock_method()
133 with patch.object(AsyncClass, 'async_method') as mock_method:
134 self.assertIsInstance(mock_method, AsyncMock)
184 def test_async(mock_method): argument
185 self.assertIsInstance(mock_method.async_method, AsyncMock)
186 self.assertIsInstance(mock_method, MagicMock)
189 def test_normal_method(mock_method): argument
190 self.assertIsInstance(mock_method.normal_method, MagicMock)
229 with patch(f"{__name__}.async_func_args", autospec=True) as mock_method:
230 awaitable = mock_method(1, 2, c=3)
231 self.assertIsInstance(mock_method.mock, AsyncMock)
233 self.assertTrue(asyncio.iscoroutinefunction(mock_method))
238 self.assertEqual(mock_method.await_count, 0)
239 self.assertEqual(mock_method.await_args_list, [])
240 self.assertIsNone(mock_method.await_args)
241 mock_method.assert_not_awaited()
245 self.assertEqual(mock_method.await_count, 1)
246 self.assertEqual(mock_method.await_args, call(1, 2, c=3))
247 self.assertEqual(mock_method.await_args_list, [call(1, 2, c=3)])
248 mock_method.assert_awaited_once()
249 mock_method.assert_awaited_once_with(1, 2, c=3)
250 mock_method.assert_awaited_with(1, 2, c=3)
251 mock_method.assert_awaited()
253 mock_method.reset_mock()
254 self.assertEqual(mock_method.await_count, 0)
255 self.assertIsNone(mock_method.await_args)
256 self.assertEqual(mock_method.await_args_list, [])
323 def test_async(mock_method): argument
324 self.assertIsInstance(mock_method, AsyncMock)
330 def test_async(mock_method): argument
331 self.assertIsInstance(mock_method, MagicMock)
332 self.assertIsInstance(mock_method.async_method, AsyncMock)
338 def test_async_attribute(mock_method): argument
339 self.assertIsInstance(mock_method, MagicMock)
340 self.assertFalse(inspect.iscoroutine(mock_method))
341 self.assertFalse(inspect.isawaitable(mock_method))