Skip to content

Commit

Permalink
Add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
elprans committed Oct 17, 2024
1 parent c78eec1 commit d43ef44
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/test_copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,20 +148,22 @@ async def test_copy_from_query_with_args(self):

res = await self.con.copy_from_query('''
SELECT
i, i * 10
i,
i * 10,
$2::text
FROM
generate_series(1, 5) AS i
WHERE
i = $1
''', 3, output=f)
''', 3, None, output=f)

self.assertEqual(res, 'COPY 1')

output = f.getvalue().decode().split('\n')
self.assertEqual(
output,
[
'3\t30',
'3\t30\t\\N',
''
]
)
Expand Down

0 comments on commit d43ef44

Please sign in to comment.