MCPcopy
hub / github.com/psycopg/psycopg / test_binary_cursor_execute

Function test_binary_cursor_execute

tests/test_cursor_common.py:314–325  ·  view source on GitHub ↗
(conn)

Source from the content-addressed store, hash-verified

312
313
314def test_binary_cursor_execute(conn):
315 with raiseif(
316 conn.cursor_factory is psycopg.ClientCursor, psycopg.NotSupportedError
317 ) as ex:
318 cur = conn.cursor(binary=True)
319 cur.execute(ph(cur, "select %s, %s"), [1, None])
320 if ex:
321 return
322
323 assert cur.fetchone() == (1, None)
324 assert cur.pgresult.fformat(0) == 1
325 assert cur.pgresult.get_value(0, 0) == b"\x00\x01"
326
327
328def test_execute_binary(conn):

Callers

nothing calls this directly

Calls 7

raiseifFunction · 0.85
phFunction · 0.85
cursorMethod · 0.45
executeMethod · 0.45
fetchoneMethod · 0.45
fformatMethod · 0.45
get_valueMethod · 0.45

Tested by

no test coverage detected