| 556 | |
| 557 | |
| 558 | def test_copy_in_allchars(conn): |
| 559 | cur = conn.cursor() |
| 560 | ensure_table(cur, sample_tabledef) |
| 561 | |
| 562 | conn.execute("set client_encoding to utf8") |
| 563 | with cur.copy("copy copy_in from stdin (format text)") as copy: |
| 564 | for i in range(1, 256): |
| 565 | copy.write_row((i, None, chr(i))) |
| 566 | copy.write_row((ord(eur), None, eur)) |
| 567 | |
| 568 | cur.execute(""" |
| 569 | select col1 = ascii(data), col2 is null, length(data), count(*) |
| 570 | from copy_in group by 1, 2, 3 |
| 571 | """) |
| 572 | data = cur.fetchall() |
| 573 | assert data == [(True, True, 1, 256)] |
| 574 | |
| 575 | |
| 576 | def test_copy_in_format(conn): |