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

Method test_prepare_29_duplicates

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

Source from the content-addressed store, hash-verified

546 await self.con.fetchval(query, *range(1, N + 1))
547
548 async def test_prepare_29_duplicates(self):
549 # In addition to test_record.py, let's have a full functional
550 # test for records with duplicate keys.
551 r = await self.con.fetchrow('SELECT 1 as a, 2 as b, 3 as a')
552 self.assertEqual(list(r.items()), [('a', 1), ('b', 2), ('a', 3)])
553 self.assertEqual(list(r.keys()), ['a', 'b', 'a'])
554 self.assertEqual(list(r.values()), [1, 2, 3])
555 self.assertEqual(r['a'], 3)
556 self.assertEqual(r['b'], 2)
557 self.assertEqual(r[0], 1)
558 self.assertEqual(r[1], 2)
559 self.assertEqual(r[2], 3)
560
561 async def test_prepare_30_invalid_arg_count(self):
562 with self.assertRaisesRegex(

Callers

nothing calls this directly

Calls 1

fetchrowMethod · 0.45

Tested by

no test coverage detected