Skip to content

Commit d483667

Browse files
committed
Data type converter: Add test case for exercising removal of converters
1 parent 00dbb42 commit d483667

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/crate/client/test_cursor.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def test_execute_with_converter(self):
6363
# Create a `Cursor` object with converter.
6464
c = conn.cursor(converter=converter)
6565

66-
# Make up a response using CrateDB data types `STRING`, `IP`,
66+
# Make up a response using CrateDB data types `TEXT`, `IP`,
6767
# `TIMESTAMP`, `BIT`.
6868
conn.client.set_next_response({
6969
"col_types": [4, 5, 11, 25],
@@ -81,4 +81,14 @@ def test_execute_with_converter(self):
8181
datetime(2022, 7, 18, 18, 10, 36, 758000),
8282
6
8383
])
84+
85+
# When removing the converters, all values are forwarded 1:1.
86+
converter.remove(CrateDatatypeIdentifier.TEXT)
87+
converter.remove(CrateDatatypeIdentifier.IP)
88+
converter.remove(CrateDatatypeIdentifier.TIMESTAMP)
89+
converter.remove(CrateDatatypeIdentifier.BIT)
90+
c.execute("")
91+
result = c.fetchone()
92+
self.assertEqual(result, ['foo', '10.10.10.1', 1658167836758, "B'0110'"])
93+
8494
conn.close()

0 commit comments

Comments
 (0)