MCPcopy
hub / github.com/psycopg/psycopg / test_as_bytes

Method test_as_bytes

tests/test_sql.py:289–294  ·  view source on GitHub ↗
(self, conn, args, want, enc)

Source from the content-addressed store, hash-verified

287
288 @pytest.mark.parametrize("args, want, enc", _as_bytes_params)
289 def test_as_bytes(self, conn, args, want, enc):
290 want = want.encode(enc)
291 conn.execute(f"set client_encoding to {py2pgenc(enc).decode()}")
292 got = sql.Identifier(*args).as_bytes(conn)
293 assert isinstance(got, bytes)
294 assert got == want
295
296 @pytest.mark.parametrize("args, want, enc", _as_bytes_params)
297 def test_as_bytes_no_conn(self, conn, args, want, enc):

Callers

nothing calls this directly

Calls 3

py2pgencFunction · 0.90
executeMethod · 0.45
as_bytesMethod · 0.45

Tested by

no test coverage detected