How to use the aiounittest.AsyncMockIterator function in aiounittest

To help you get started, we’ve selected a few aiounittest examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kwarunek / aiounittest / tests / test_asyncmockiterator.py View on Github external
async def test_add(self):
        source = Mock()
        mock_iter = AsyncMockIterator([
            'asdf', 'qwer', 'zxcv'
        ])
        source.paginate.return_value = mock_iter

        res = await fetch_some_text(source)
        self.assertEqual(res, 'asdfqwerzxcv')
        mock_iter.assertFullyConsumed()
        mock_iter.assertIterCount(3)

aiounittest

Test asyncio code more easily.

MIT
Latest version published 2 years ago

Package Health Score

52 / 100
Full package analysis

Similar packages