MCPcopy Create free account
hub / github.com/MagicStack/asyncpg / test_prepare_13_connect

Method test_prepare_13_connect

tests/test_prepare.py:243–252  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

241 self.assertEqual(len(self.con._stmts_to_close), 1)
242
243 async def test_prepare_13_connect(self):
244 v = await self.con.fetchval(
245 'SELECT $1::smallint AS foo', 10, column='foo')
246 self.assertEqual(v, 10)
247
248 r = await self.con.fetchrow('SELECT $1::smallint * 2 AS test', 10)
249 self.assertEqual(r['test'], 20)
250
251 rows = await self.con.fetch('SELECT generate_series(0,$1::int)', 3)
252 self.assertEqual([r[0] for r in rows], [0, 1, 2, 3])
253
254 async def test_prepare_14_explain(self):
255 # Test simple EXPLAIN.

Callers

nothing calls this directly

Calls 3

fetchvalMethod · 0.45
fetchrowMethod · 0.45
fetchMethod · 0.45

Tested by

no test coverage detected