Esempio n. 1
0
if sys.version_info[0] >= 3:
    rs.myintlist = list(range(20))
else:
    rs.myintlist = range(20)
rs.maps = {1: Wrapper(foo=Empty()), 2: Wrapper(foo=Empty())}
rs.bigint = 124523452435
rs.triple = 3.14

# make sure this splits two buffers in a buffered protocol
rshuge = RandomStuff()
if sys.version_info[0] >= 3:
    rshuge.myintlist = list(range(10000))
else:
    rshuge.myintlist = range(10000)

my_zero = Srv.Janky_result(5)


def checkWrite(o):
    trans_fast = TTransport.TMemoryBuffer()
    trans_slow = TTransport.TMemoryBuffer()
    prot_fast = TBinaryProtocol.TBinaryProtocolAccelerated(trans_fast)
    prot_slow = TBinaryProtocol.TBinaryProtocol(trans_slow)

    o.write(prot_fast)
    o.write(prot_slow)
    ORIG = trans_slow.getvalue()
    MINE = trans_fast.getvalue()
    if ORIG != MINE:
        print("mine: %s\norig: %s" % (repr(MINE), repr(ORIG)))
Esempio n. 2
0
]

rs = RandomStuff()
rs.a = 1
rs.b = 2
rs.c = 3
rs.myintlist = range(20)
rs.maps = {1: Wrapper(**{"foo": Empty()}), 2: Wrapper(**{"foo": Empty()})}
rs.bigint = 124523452435
rs.triple = 3.14

# make sure this splits two buffers in a buffered protocol
rshuge = RandomStuff()
rshuge.myintlist = range(10000)

my_zero = Srv.Janky_result(**{"success": 5})


def check_write(o):
    trans_fast = TTransport.TMemoryBuffer()
    trans_slow = TTransport.TMemoryBuffer()
    prot_fast = TBinaryProtocol.TBinaryProtocolAccelerated(trans_fast)
    prot_slow = TBinaryProtocol.TBinaryProtocol(trans_slow)

    o.write(prot_fast)
    o.write(prot_slow)
    ORIG = trans_slow.getvalue()
    MINE = trans_fast.getvalue()
    if ORIG != MINE:
        print("mine: %s\norig: %s" % (repr(MINE), repr(ORIG)))
Esempio n. 3
0
]

rs = RandomStuff()
rs.a = 1
rs.b = 2
rs.c = 3
rs.myintlist = range(20)
rs.maps = {1: Wrapper({"foo": Empty()}), 2: Wrapper({"foo": Empty()})}
rs.bigint = 124523452435L
rs.triple = 3.14

# make sure this splits two buffers in a buffered protocol
rshuge = RandomStuff()
rshuge.myintlist = range(10000)

my_zero = Srv.Janky_result({"arg": 5})
my_nega = Srv.Janky_args({"success": 6})


def checkWrite(o):
    trans_fast = TTransport.TMemoryBuffer()
    trans_slow = TTransport.TMemoryBuffer()
    prot_fast = TBinaryProtocol.TBinaryProtocolAccelerated(trans_fast)
    prot_slow = TBinaryProtocol.TBinaryProtocol(trans_slow)

    o.write(prot_fast)
    o.write(prot_slow)
    ORIG = trans_slow.getvalue()
    MINE = trans_fast.getvalue()
    if ORIG != MINE:
        print "mine: %s\norig: %s" % (repr(MINE), repr(ORIG))
Esempio n. 4
0
]

rs = RandomStuff()
rs.a = 1
rs.b = 2
rs.c = 3
rs.myintlist = range(20)
rs.maps = {1:Wrapper({"foo":Empty()}),2:Wrapper({"foo":Empty()})}
rs.bigint = 124523452435L
rs.triple = 3.14

# make sure this splits two buffers in a buffered protocol
rshuge = RandomStuff()
rshuge.myintlist=range(10000)

my_zero = Srv.Janky_result({"arg":5})

def checkWrite(o):
  trans_fast = TTransport.TMemoryBuffer()
  trans_slow = TTransport.TMemoryBuffer()
  prot_fast = TBinaryProtocol.TBinaryProtocolAccelerated(trans_fast)
  prot_slow = TBinaryProtocol.TBinaryProtocol(trans_slow)

  o.write(prot_fast)
  o.write(prot_slow)
  ORIG = trans_slow.getvalue()
  MINE = trans_fast.getvalue()
  if ORIG != MINE:
    print "mine: %s\norig: %s" % (repr(MINE), repr(ORIG))

def checkRead(o):
Esempio n. 5
0
 def test_frozen_exception_serialization(self):
     result = Srv.declaredExceptionMethod_result(xwamap=ExceptionWithAMap(
         blah="error"))
     deserialized = self._roundtrip(result,
                                    Srv.declaredExceptionMethod_result())
     self.assertEqual(result, deserialized)