MCPcopy
hub / github.com/psycopg/psycopg / test_unparsed_roundtrip

Method test_unparsed_roundtrip

tests/test_tpc.py:229–242  ·  view source on GitHub ↗
(self, conn_cls, conn, dsn, tpc, tid)

Source from the content-addressed store, hash-verified

227
228 @pytest.mark.parametrize("tid", ["", "hello, world!", "x" * 199])
229 def test_unparsed_roundtrip(self, conn_cls, conn, dsn, tpc, tid):
230 conn.tpc_begin(tid)
231 conn.tpc_prepare()
232 conn.close()
233
234 with conn_cls.connect(dsn) as conn:
235 xids = [x for x in conn.tpc_recover() if x.database == conn.info.dbname]
236 assert len(xids) == 1
237 xid = xids[0]
238 conn.tpc_rollback(xid)
239
240 assert xid.format_id is None
241 assert xid.gtrid == tid
242 assert xid.bqual is None
243
244 def test_xid_unicode(self, conn_cls, conn, dsn, tpc):
245 x1 = conn.xid(10, "uni", "code")

Callers

nothing calls this directly

Calls 6

tpc_beginMethod · 0.45
tpc_prepareMethod · 0.45
closeMethod · 0.45
connectMethod · 0.45
tpc_recoverMethod · 0.45
tpc_rollbackMethod · 0.45

Tested by

no test coverage detected