Beispiel #1
0
 def test_fixnum(self):
     # positive fixnum
     for v in range(-1, 127):
         s = msgpack_dump(v)
         o = msgpack_load(s)
         self.failUnless(o == v, "o=%s, v=%s" % (o, v))
     # negative fixnum
     for v in range(-32, 0):
         s = msgpack_dump(v)
         o = msgpack_load(s)
         self.failUnless(o == v, "o=%s, v=%s" % (o, v))
Beispiel #2
0
 def test_fixnum(self):
     # positive fixnum
     for v in range(-1, 127):
         s = msgpack_dump(v)
         o = msgpack_load(s)
         self.failUnless(o == v, "o=%s, v=%s" % (o,v))
     # negative fixnum
     for v in range(-32, 0):
         s = msgpack_dump(v)
         o = msgpack_load(s)
         self.failUnless(o == v, "o=%s, v=%s" % (o,v))
Beispiel #3
0
 def test_map16(self):
     v = dict()
     for x in range(0, 16):
         v[u"k%i" % x] = u"v%i" % x
     s = msgpack_dump(v)
     o = msgpack_load(s)
     self.failUnless(o == v, "\no=%s\nv=%s" % (o, v))
Beispiel #4
0
 def test_map16(self):
     v = dict()
     for x in range(0, 16):
         v[u"k%i" % x] = u"v%i" % x
     s = msgpack_dump(v)
     o = msgpack_load(s)
     self.failUnless(o == v, "\no=%s\nv=%s" % (o,v))
Beispiel #5
0
 def test_map32(self):
     v = dict()
     for x in range(0, 100000):
         v[u"k%i" % x] = u"v%i" % x
     s = msgpack_dump(v)
     o = msgpack_load(s)
     #self.failUnless(o == v, "o=%s, v=%s" % (o,v))
     self.failUnless(o == v)
Beispiel #6
0
 def test_map32(self):
     v = dict()
     for x in range(0, 100000):
         v[u"k%i" % x] = u"v%i" % x
     s = msgpack_dump(v)
     o = msgpack_load(s)
     #self.failUnless(o == v, "o=%s, v=%s" % (o,v))
     self.failUnless(o == v)
Beispiel #7
0
 def test_int64(self):
     v = -10000000
     s = msgpack_dump(v)
     o = msgpack_load(s)
     self.failUnless(o == v, "o=%s, v=%s" % (o, v))
Beispiel #8
0
 def test_fixmap(self):
     v = {u'foo': u'bar', u'baz': u'qux'}
     s = msgpack_dump(v)
     o = msgpack_load(s)
     self.failUnless(o == v, "o=%s, v=%s" % (o,v))
Beispiel #9
0
 def test_array32(self):
     v = [x for x in range(0, 100000)]
     s = msgpack_dump(v)
     o = msgpack_load(s)
     self.failUnless(o == v, "o=%s, v=%s" % (o, v))
Beispiel #10
0
 def test_fixarray(self):
     v = [1,2,3,4,5]
     s = msgpack_dump(v)
     o = msgpack_load(s)
     self.failUnless(o == v, "o=%s, v=%s" % (o,v))
Beispiel #11
0
 def test_array32(self):
     v = [x for x in range(0, 100000)]
     s = msgpack_dump(v)
     o = msgpack_load(s)
     self.failUnless(o == v, "o=%s, v=%s" % (o,v))
Beispiel #12
0
 def test_float(self):
     v = float(3.14159)
     s = msgpack_dump(v)
     o = msgpack_load(s)
     self.failUnless(o == v, "o=%s, v=%s" % (o,v))
Beispiel #13
0
 def test_fixarray(self):
     v = [1, 2, 3, 4, 5]
     s = msgpack_dump(v)
     o = msgpack_load(s)
     self.failUnless(o == v, "o=%s, v=%s" % (o, v))
Beispiel #14
0
 def test_None(self):
     v = None
     s = msgpack_dump(v)
     o = msgpack_load(s)
     self.failUnless(o == v, "o=%s, v=%s" % (o,v))
Beispiel #15
0
 def test_dict_key_types(self):
     v = {False: None, 1: None, u'two': None, 3.14159: None, u'foo': None}
     s = msgpack_dump(v)
     o = msgpack_load(s)
     self.failUnless(o == v, "o=%s, v=%s" % (o,v))
Beispiel #16
0
 def test_None(self):
     v = None
     s = msgpack_dump(v)
     o = msgpack_load(s)
     self.failUnless(o == v, "o=%s, v=%s" % (o, v))
Beispiel #17
0
 def test_fixmap(self):
     v = {u'foo': u'bar', u'baz': u'qux'}
     s = msgpack_dump(v)
     o = msgpack_load(s)
     self.failUnless(o == v, "o=%s, v=%s" % (o, v))
Beispiel #18
0
 def test_dict_key_types(self):
     v = {False: None, 1: None, u'two': None, 3.14159: None, u'foo': None}
     s = msgpack_dump(v)
     o = msgpack_load(s)
     self.failUnless(o == v, "o=%s, v=%s" % (o, v))
Beispiel #19
0
 def test_float(self):
     v = float(3.14159)
     s = msgpack_dump(v)
     o = msgpack_load(s)
     self.failUnless(o == v, "o=%s, v=%s" % (o, v))
Beispiel #20
0
 def test_fixraw(self):
     v = unicode("hello, world!")
     s = msgpack_dump(v)
     o = msgpack_load(s)
     self.failUnless(o == v, "o=%s, v=%s" % (o, v))
Beispiel #21
0
 def test_int64(self):
     v = -10000000
     s = msgpack_dump(v)
     o = msgpack_load(s)
     self.failUnless(o == v, "o=%s, v=%s" % (o,v))
Beispiel #22
0
 def test_raw32(self):
     v = unicode("helloworld") * 10000
     s = msgpack_dump(v)
     o = msgpack_load(s)
     self.failUnless(o == v, "o=%s, v=%s" % (o,v))
Beispiel #23
0
 def test_fixraw(self):
     v = unicode("hello, world!")
     s = msgpack_dump(v)
     o = msgpack_load(s)
     self.failUnless(o == v, "o=%s, v=%s" % (o,v))
Beispiel #24
0
 def test_raw32(self):
     v = unicode("helloworld") * 10000
     s = msgpack_dump(v)
     o = msgpack_load(s)
     self.failUnless(o == v, "o=%s, v=%s" % (o, v))