Skip to content

Commit

Permalink
Add float_vector asyncpg test
Browse files Browse the repository at this point in the history
  • Loading branch information
matriv committed Sep 21, 2023
1 parent f38641c commit 2af78ef
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/client_tests/python/asyncpg/test_asyncpg.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,18 @@ async def bitstring_can_be_inserted_and_selected_using_binary_encoding(test, con
test.assertEqual(result[0][0], xs)


async def float_vector_can_be_inserted_and_selected(test, conn):
xs = [1.1, 2.2, 3.3, 4.4]
await conn.execute('drop table if exists tbl_fv')
await conn.execute('create table tbl_fv (id int, xs float(4))')
await conn.execute('insert into tbl_fv (xs) values (1, ?)', xs)
await conn.execute('insert into tbl_fv (xs) values (2, ?)', None)
await conn.execute('refresh table tbl_fv')
result = await conn.fetch('select xs from tbl_fv order by id')
test.assertEqual(result[0][0], xs)
test.assertNone(result[0][0])


async def fetch_summits(test, uri):
conn = await asyncpg.connect(uri)
async with conn.transaction():
Expand Down

0 comments on commit 2af78ef

Please sign in to comment.