MCPcopy
hub / github.com/psycopg/psycopg / test_as_bytes_encoding

Method test_as_bytes_encoding

tests/test_sql.py:365–367  ·  view source on GitHub ↗
(self, conn, encoding)

Source from the content-addressed store, hash-verified

363
364 @pytest.mark.parametrize("encoding", ["utf8", crdb_encoding("latin9")])
365 def test_as_bytes_encoding(self, conn, encoding):
366 conn.execute(f"set client_encoding to {encoding}")
367 assert sql.Literal(eur).as_bytes(conn) == f"'{eur}'".encode(encoding)
368
369 def test_eq(self):
370 assert sql.Literal("foo") == sql.Literal("foo")

Callers

nothing calls this directly

Calls 2

executeMethod · 0.45
as_bytesMethod · 0.45

Tested by

no test coverage detected