Skip to content

Commit

Permalink
add test showing enums not being converted
Browse files Browse the repository at this point in the history
  • Loading branch information
mjperrone committed Jan 17, 2024
1 parent b08bf51 commit 69882b4
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions tests/integration/clients/test_postgresql.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from recap.types import (
BoolType,
BytesType,
EnumType,
FloatType,
IntType,
ListType,
Expand All @@ -30,8 +31,18 @@ def setup_class(cls):
dbname="testdb",
)

# Create tables
# Create custom types
cursor = cls.connection.cursor()
cursor.execute(
"""
CREATE TYPE test_enum_type_mood AS ENUM (
'sad',
'ok',
'happy'
);
""")

# Create tables
cursor.execute(
"""
CREATE TABLE IF NOT EXISTS test_types (
Expand All @@ -55,7 +66,8 @@ def setup_class(cls):
test_bit_array BIT(8)[],
test_not_null_array INTEGER[] NOT NULL,
test_int_array_2d INTEGER[][],
test_text_array_3d TEXT[][][]
test_text_array_3d TEXT[][][],
test_enum_mood test_enum_type_mood
);
"""
)
Expand All @@ -66,6 +78,7 @@ def teardown_class(cls):
# Delete tables
cursor = cls.connection.cursor()
cursor.execute("DROP TABLE IF EXISTS test_types;")
cursor.execute("DROP TYPE IF EXISTS test_enum_type_mood;")
cls.connection.commit()

# Close the connection
Expand Down Expand Up @@ -266,6 +279,7 @@ def test_struct_method_arrays_no_enforce_dimensions(self):
),
],
),
EnumType(default=None, symbols=["sad", "ok", "happy"], name="test_enum_mood"),
]
validate_results(test_types_struct, expected_fields)

Expand Down

0 comments on commit 69882b4

Please sign in to comment.