(self, conn, encoding)
| 502 | |
| 503 | @pytest.mark.parametrize("encoding", ["utf8", crdb_encoding("latin9")]) |
| 504 | def test_as_bytes(self, conn, encoding): |
| 505 | if encoding: |
| 506 | conn.execute(f"set client_encoding to {encoding}") |
| 507 | |
| 508 | got = sql.SQL(eur).as_bytes(conn) |
| 509 | assert isinstance(got, bytes) |
| 510 | assert got == eur.encode(encoding) |
| 511 | |
| 512 | def test_no_conn(self): |
| 513 | assert sql.SQL(eur).as_string() == eur |