(self)
| 388 | self.assertIsInstance(r, CustomRecord) |
| 389 | |
| 390 | async def test_record_subclass_02(self): |
| 391 | r = await self.con.fetchrow( |
| 392 | "SELECT 1 as a, '2' as b", |
| 393 | record_class=CustomRecord, |
| 394 | ) |
| 395 | self.assertIsInstance(r, CustomRecord) |
| 396 | |
| 397 | r = await self.con.fetch( |
| 398 | "SELECT 1 as a, '2' as b", |
| 399 | record_class=CustomRecord, |
| 400 | ) |
| 401 | self.assertIsInstance(r[0], CustomRecord) |
| 402 | |
| 403 | async with self.con.transaction(): |
| 404 | cur = await self.con.cursor( |
| 405 | "SELECT 1 as a, '2' as b", |
| 406 | record_class=CustomRecord, |
| 407 | ) |
| 408 | r = await cur.fetchrow() |
| 409 | self.assertIsInstance(r, CustomRecord) |
| 410 | |
| 411 | cur = await self.con.cursor( |
| 412 | "SELECT 1 as a, '2' as b", |
| 413 | record_class=CustomRecord, |
| 414 | ) |
| 415 | r = await cur.fetch(1) |
| 416 | self.assertIsInstance(r[0], CustomRecord) |
| 417 | |
| 418 | async with self.con.transaction(): |
| 419 | cur = self.con.cursor( |
| 420 | "SELECT 1 as a, '2' as b", |
| 421 | record_class=CustomRecord, |
| 422 | ) |
| 423 | async for r in cur: |
| 424 | self.assertIsInstance(r, CustomRecord) |
| 425 | |
| 426 | ps = await self.con.prepare( |
| 427 | "SELECT 1 as a, '2' as b", |
| 428 | record_class=CustomRecord, |
| 429 | ) |
| 430 | r = await ps.fetchrow() |
| 431 | self.assertIsInstance(r, CustomRecord) |
| 432 | |
| 433 | r = await ps.fetch() |
| 434 | self.assertIsInstance(r[0], CustomRecord) |
| 435 | |
| 436 | @tb.with_connection_options(record_class=AnotherCustomRecord) |
| 437 | async def test_record_subclass_03(self): |
nothing calls this directly
no test coverage detected