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

Method test_enum_in_composite

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

Source from the content-addressed store, hash-verified

1942 ''')
1943
1944 async def test_enum_in_composite(self):
1945 await self.con.execute('''
1946 CREATE TYPE enum_t AS ENUM ('abc', 'def', 'ghi');
1947 CREATE TYPE composite_w_enum AS (a int, b enum_t);
1948 ''')
1949
1950 try:
1951 result = await self.con.fetchval('''
1952 SELECT ROW(1, 'def'::enum_t)::composite_w_enum
1953 ''')
1954 self.assertEqual(set(result.items()), {('a', 1), ('b', 'def')})
1955
1956 finally:
1957 await self.con.execute('''
1958 DROP TYPE composite_w_enum;
1959 DROP TYPE enum_t;
1960 ''')
1961
1962 async def test_enum_function_return(self):
1963 await self.con.execute('''

Callers

nothing calls this directly

Calls 2

executeMethod · 0.45
fetchvalMethod · 0.45

Tested by

no test coverage detected