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

Method test_composites_in_arrays

tests/test_codecs.py:1661–1681  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1659 await self.con.execute('RESET ALL')
1660
1661 async def test_composites_in_arrays(self):
1662 await self.con.execute('''
1663 CREATE TYPE t AS (a text, b int);
1664 CREATE TABLE tab (d t[]);
1665 ''')
1666
1667 try:
1668 await self.con.execute(
1669 'INSERT INTO tab (d) VALUES ($1)',
1670 [('a', 1)])
1671
1672 r = await self.con.fetchval('''
1673 SELECT d FROM tab
1674 ''')
1675
1676 self.assertEqual(r, [('a', 1)])
1677 finally:
1678 await self.con.execute('''
1679 DROP TABLE tab;
1680 DROP TYPE t;
1681 ''')
1682
1683 async def test_table_as_composite(self):
1684 await self.con.execute('''

Callers

nothing calls this directly

Calls 2

executeMethod · 0.45
fetchvalMethod · 0.45

Tested by

no test coverage detected