def testXid(self):
sc = StringCodec()
xid = Xid(format=0, global_id="gid", branch_id="bid")
sc.write_compound(xid)
assert sc.encoded == '\x00\x00\x00\x10\x06\x04\x07\x00\x00\x00\x00\x00\x03gid\x03bid'
dec = sc.read_compound(Xid)
assert xid.__dict__ == dec.__dict__
# def testLoadReadOnly(self):
# spec = "amqp.0-10-qpid-errata.xml"
# f = testrunner.get_spec_file(spec)
# dest = tempfile.mkdtemp()
# shutil.copy(f, dest)
# shutil.copy(os.path.join(os.path.dirname(f), "amqp.0-10.dtd"), dest)
# os.chmod(dest, stat.S_IRUSR | stat.S_IXUSR)
# fname = os.path.join(dest, spec)
# load(fname)
# assert not os.path.exists("%s.pcl" % fname)
评论列表
文章目录