diff options
Diffstat (limited to 'test/dialect/postgresql/test_reflection.py')
-rw-r--r-- | test/dialect/postgresql/test_reflection.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/dialect/postgresql/test_reflection.py b/test/dialect/postgresql/test_reflection.py index ae1dff6d0..f2e491167 100644 --- a/test/dialect/postgresql/test_reflection.py +++ b/test/dialect/postgresql/test_reflection.py @@ -1291,6 +1291,33 @@ class ReflectionTest(fixtures.TestBase): ) @testing.provide_metadata + def test_inspect_enum_empty(self): + enum_type = postgresql.ENUM(name="empty", metadata=self.metadata) + enum_type.create(testing.db) + inspector = reflection.Inspector.from_engine(testing.db) + + eq_( + inspector.get_enums(), + [ + { + "visible": True, + "labels": [], + "name": "empty", + "schema": "public", + } + ], + ) + + @testing.provide_metadata + def test_inspect_enum_empty_from_table(self): + Table( + "t", self.metadata, Column("x", postgresql.ENUM(name="empty")) + ).create(testing.db) + + t = Table("t", MetaData(testing.db), autoload_with=testing.db) + eq_(t.c.x.type.enums, []) + + @testing.provide_metadata @testing.only_on("postgresql >= 8.5") def test_reflection_with_unique_constraint(self): insp = inspect(testing.db) |