MCPcopy
hub / github.com/psycopg/psycopg / test_xid_unicode

Method test_xid_unicode

tests/test_tpc_async.py:248–261  ·  view source on GitHub ↗
(self, aconn_cls, aconn, dsn, tpc)

Source from the content-addressed store, hash-verified

246 assert xid.bqual is None
247
248 async def test_xid_unicode(self, aconn_cls, aconn, dsn, tpc):
249 x1 = aconn.xid(10, "uni", "code")
250 await aconn.tpc_begin(x1)
251 await aconn.tpc_prepare()
252 await aconn.close()
253
254 async with await aconn_cls.connect(dsn) as aconn:
255 xid = [
256 x for x in await aconn.tpc_recover() if x.database == aconn.info.dbname
257 ][0]
258
259 assert 10 == xid.format_id
260 assert "uni" == xid.gtrid
261 assert "code" == xid.bqual
262
263 async def test_xid_unicode_unparsed(self, aconn_cls, aconn, dsn, tpc):
264 # We don't expect people shooting snowmen as transaction ids,

Callers

nothing calls this directly

Calls 6

xidMethod · 0.80
tpc_beginMethod · 0.45
tpc_prepareMethod · 0.45
closeMethod · 0.45
connectMethod · 0.45
tpc_recoverMethod · 0.45

Tested by

no test coverage detected