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

Method test_enum_in_array

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

Source from the content-addressed store, hash-verified

1897 await self.con.execute(r'DROP EXTENSION citext')
1898
1899 async def test_enum_in_array(self):
1900 await self.con.execute('''
1901 CREATE TYPE enum_t AS ENUM ('abc', 'def', 'ghi');
1902 ''')
1903
1904 try:
1905 result = await self.con.fetchrow('''SELECT $1::enum_t[];''',
1906 ['abc'])
1907 self.assertEqual(result, (['abc'],))
1908
1909 result = await self.con.fetchrow('''SELECT ARRAY[$1::enum_t];''',
1910 'abc')
1911
1912 self.assertEqual(result, (['abc'],))
1913
1914 finally:
1915 await self.con.execute('''
1916 DROP TYPE enum_t;
1917 ''')
1918
1919 async def test_enum_and_range(self):
1920 await self.con.execute('''

Callers

nothing calls this directly

Calls 2

executeMethod · 0.45
fetchrowMethod · 0.45

Tested by

no test coverage detected