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

Method test_enum_in_composite

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

Source from the content-addressed store, hash-verified

1896 ''')
1897
1898 async def test_enum_in_composite(self):
1899 await self.con.execute('''
1900 CREATE TYPE enum_t AS ENUM ('abc', 'def', 'ghi');
1901 CREATE TYPE composite_w_enum AS (a int, b enum_t);
1902 ''')
1903
1904 try:
1905 result = await self.con.fetchval('''
1906 SELECT ROW(1, 'def'::enum_t)::composite_w_enum
1907 ''')
1908 self.assertEqual(set(result.items()), {('a', 1), ('b', 'def')})
1909
1910 finally:
1911 await self.con.execute('''
1912 DROP TYPE composite_w_enum;
1913 DROP TYPE enum_t;
1914 ''')
1915
1916 async def test_enum_function_return(self):
1917 await self.con.execute('''

Callers

nothing calls this directly

Calls 2

executeMethod · 0.45
fetchvalMethod · 0.45

Tested by

no test coverage detected