Skip to content

Commit 70ff5d4

Browse files
committed
Improved tests [skip ci]
1 parent df1766b commit 70ff5d4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/test_psycopg2.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@ def test_halfvec(self):
4949
assert res[0][0] == HalfVector([1.5, 2, 3])
5050
assert res[1][0] is None
5151

52+
def test_halfvec_class(self):
53+
embedding = HalfVector([1.5, 2, 3])
54+
cur.execute('INSERT INTO psycopg2_items (half_embedding) VALUES (%s), (NULL)', (embedding,))
55+
56+
cur.execute('SELECT half_embedding FROM psycopg2_items ORDER BY id')
57+
res = cur.fetchall()
58+
assert res[0][0] == embedding
59+
assert res[1][0] is None
60+
5261
def test_bit(self):
5362
embedding = '101'
5463
cur.execute('INSERT INTO psycopg2_items (binary_embedding) VALUES (%s), (NULL)', (embedding,))

0 commit comments

Comments
 (0)