MCPcopy
hub / github.com/MagicStack/asyncpg / test_enum_in_array

Method test_enum_in_array

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

Source from the content-addressed store, hash-verified

1851 await self.con.execute(r'DROP EXTENSION citext')
1852
1853 async def test_enum_in_array(self):
1854 await self.con.execute('''
1855 CREATE TYPE enum_t AS ENUM ('abc', 'def', 'ghi');
1856 ''')
1857
1858 try:
1859 result = await self.con.fetchrow('''SELECT $1::enum_t[];''',
1860 ['abc'])
1861 self.assertEqual(result, (['abc'],))
1862
1863 result = await self.con.fetchrow('''SELECT ARRAY[$1::enum_t];''',
1864 'abc')
1865
1866 self.assertEqual(result, (['abc'],))
1867
1868 finally:
1869 await self.con.execute('''
1870 DROP TYPE enum_t;
1871 ''')
1872
1873 async def test_enum_and_range(self):
1874 await self.con.execute('''

Callers

nothing calls this directly

Calls 2

executeMethod · 0.45
fetchrowMethod · 0.45

Tested by

no test coverage detected