File: test_cursor.py

package info (click to toggle)
python-beanie 2.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,480 kB
  • sloc: python: 14,427; makefile: 7; sh: 6
file content (13 lines) | stat: -rw-r--r-- 366 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
from tests.odm.models import DocumentTestModel


async def test_to_list(documents):
    await documents(10)
    result = await DocumentTestModel.find_all().to_list()
    assert len(result) == 10


async def test_async_for(documents):
    await documents(10)
    async for document in DocumentTestModel.find_all():
        assert document.test_int in list(range(10))