Skip to content

Commit 4cea7df

Browse files
committed
test(datatype, varbyte): ensure support
1 parent a91ca52 commit 4cea7df

File tree

1 file changed

+73
-2
lines changed

1 file changed

+73
-2
lines changed

test/integration/datatype/_generate_test_datatype_tables.py

Lines changed: 73 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,16 @@ class RedshiftDatatypes(Enum):
2424

2525
super = auto()
2626
geometry = auto()
27+
varbyte = auto()
2728

2829
@classmethod
2930
def list(cls) -> typing.List["RedshiftDatatypes"]:
3031
return list(map(lambda p: p, cls)) # type: ignore
3132

3233

33-
redshift_test_data: typing.Dict[str, typing.Tuple[typing.Tuple[str, str], ...]] = {
34+
redshift_test_data: typing.Dict[
35+
str, typing.Union[typing.Tuple[typing.Tuple[str, str], ...], typing.List[typing.Tuple[str, bytes]]]
36+
] = {
3437
RedshiftDatatypes.geometry.name: (
3538
(
3639
"ST_GeomFromText('LINESTRING(1 2,3 4,5 6,7 8,9 10,11 12,13 14,15 16,17 18,19 20)')",
@@ -82,7 +85,75 @@ def list(cls) -> typing.List["RedshiftDatatypes"]:
8285
"f000000000000f03f000000000000f03f000000000000f03f000000000000000000000000000000000000000000000000"
8386
),
8487
),
85-
)
88+
),
89+
RedshiftDatatypes.varbyte.name: [
90+
("'{}'::varbyte".format(x), bytes(x, encoding="utf-8"))
91+
for x in (
92+
"00",
93+
"1111",
94+
"11",
95+
"222222",
96+
"22",
97+
"33333333",
98+
"33",
99+
"44444444",
100+
"44",
101+
"5555555555",
102+
"55",
103+
"666666666666",
104+
"66",
105+
"77777777777777",
106+
"77",
107+
"8888888888888888",
108+
"88",
109+
"999999999999999999",
110+
"99",
111+
"aa",
112+
"aa",
113+
"bbbb",
114+
"bb",
115+
"cccccc",
116+
"cc",
117+
"dddddddd",
118+
"dd",
119+
"eeeeeeeeee",
120+
"ee",
121+
"ffffffffffff",
122+
"ff",
123+
"aa00",
124+
"00",
125+
"bb1111",
126+
"1111",
127+
"cc222222",
128+
"222222",
129+
"dd33333333",
130+
"33333333",
131+
"ee4444444444",
132+
"4444444444",
133+
"ff555555555555",
134+
"555555555555",
135+
"0066666666666666",
136+
"66666666666666",
137+
"117777777777777777",
138+
"7777777777777777",
139+
"22888888888888888888",
140+
"888888888888888888",
141+
"3399",
142+
"99",
143+
"44aaaa",
144+
"aaaa",
145+
"55bbbbbb",
146+
"bbbbbb",
147+
"66cccccccc",
148+
"cccccccc",
149+
"77dddddddddd",
150+
"dddddddddd",
151+
"88eeeeeeeeeeee",
152+
"eeeeeeeeeeee",
153+
"99ffffffffffffff",
154+
"ffffffffffffff",
155+
)
156+
],
86157
}
87158

88159

0 commit comments

Comments
 (0)