(self)
| 63 | self.assertEqual(res, val) |
| 64 | |
| 65 | async def test_prepare_04(self): |
| 66 | s = await self.con.prepare('SELECT $1::smallint') |
| 67 | self.assertEqual(await s.fetchval(10), 10) |
| 68 | |
| 69 | s = await self.con.prepare('SELECT $1::smallint * 2') |
| 70 | self.assertEqual(await s.fetchval(10), 20) |
| 71 | |
| 72 | s = await self.con.prepare('SELECT generate_series(5,10)') |
| 73 | self.assertEqual(await s.fetchval(), 5) |
| 74 | # Since the "execute" message was sent with a limit=1, |
| 75 | # we will receive a PortalSuspended message, instead of |
| 76 | # CommandComplete. Which means there will be no status |
| 77 | # message set. |
| 78 | self.assertIsNone(s.get_statusmsg()) |
| 79 | # Repeat the same test for 'fetchrow()'. |
| 80 | self.assertEqual(await s.fetchrow(), (5,)) |
| 81 | self.assertIsNone(s.get_statusmsg()) |
| 82 | |
| 83 | async def test_prepare_05_unknownoid(self): |
| 84 | s = await self.con.prepare("SELECT 'test'") |
nothing calls this directly
no test coverage detected