MCPcopy
hub / github.com/MagicStack/asyncpg / test_copy_to_table_from_bytes_like

Method test_copy_to_table_from_bytes_like

tests/test_copy.py:489–499  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

487 await self.con.execute('DROP TABLE copytab')
488
489 async def test_copy_to_table_from_bytes_like(self):
490 await self.con.execute('''
491 CREATE TABLE copytab(a text, b text);
492 ''')
493
494 try:
495 data = memoryview((b'a1' * 500 + b'\t' + b'b1' * 500 + b'\n') * 2)
496 res = await self.con.copy_to_table('copytab', source=data)
497 self.assertEqual(res, 'COPY 2')
498 finally:
499 await self.con.execute('DROP TABLE copytab')
500
501 async def test_copy_to_table_fail_in_source_1(self):
502 await self.con.execute('''

Callers

nothing calls this directly

Calls 2

executeMethod · 0.45
copy_to_tableMethod · 0.45

Tested by

no test coverage detected