from unittest.mock import AsyncMock async def foo(bar): return bar * 2 async def test_foo(): mock = AsyncMock(return_value=6) result = await foo(mock) mock.assert_called_once_with(3) assert result == 6This code mocks the foo function, which multiplies its input by 2. In the test, an AsyncMock is created and passed to the foo function. The assert_called_once_with method is used to verify that the mock was called only once and with an input of 3. Finally, the test verifies that the result of the foo function is equal to 6. The package library used in this example is unittest.mock, which is part of the Python standard library.