Skip to content

Commit 87c4590

Browse files
committed
Added test case for an enum inside of an array
1 parent a2e53ab commit 87c4590

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/test_codecs.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,3 +1161,17 @@ async def test_unknown_type_text_fallback(self):
11611161
await self.con.execute(r'DROP TYPE citext_range')
11621162
await self.con.execute(r'DROP TYPE citext_dom')
11631163
await self.con.execute(r'DROP EXTENSION citext')
1164+
1165+
async def test_enum_in_array(self):
1166+
await self.con.execute('''
1167+
CREATE TYPE enum_t AS ENUM ('abc', 'def', 'ghi');
1168+
''')
1169+
result = await self.con.fetchrow('''SELECT ARRAY[$1::enum_t];''',
1170+
'abc')
1171+
1172+
self.assertEqual(result, ['abc'])
1173+
1174+
await self.con.execute('''
1175+
DROP TYPE enum_t;
1176+
''')
1177+

0 commit comments

Comments
 (0)