| 1395 | ) |
| 1396 | @async_test |
| 1397 | async def test_one_success(self, async_engine, filter_): |
| 1398 | users = self.tables.users |
| 1399 | async with async_engine.connect() as conn: |
| 1400 | result = await conn.stream( |
| 1401 | select(users).limit(1).order_by(users.c.user_name) |
| 1402 | ) |
| 1403 | |
| 1404 | if filter_ == "mappings": |
| 1405 | result = result.mappings() |
| 1406 | elif filter_ == "scalars": |
| 1407 | result = result.scalars() |
| 1408 | u1 = await result.one() |
| 1409 | |
| 1410 | if filter_ == "mappings": |
| 1411 | eq_(u1, {"user_id": 1, "user_name": "name%d" % 1}) |
| 1412 | elif filter_ == "scalars": |
| 1413 | eq_(u1, 1) |
| 1414 | else: |
| 1415 | eq_(u1, (1, "name%d" % 1)) |
| 1416 | |
| 1417 | @async_test |
| 1418 | async def test_one_no_result(self, async_engine): |