Example #1
0
 def test_decode_dict_noval_err(self):
     with self.assertRaises(decoder.DecodeError):
         decoder.decode_dict(b'd3:cowe')
Example #2
0
 def test_decode_dict_intkey_err(self):
     with self.assertRaises(decoder.DecodeError):
         decoder.decode_dict(b'di12e3:mooe')
Example #3
0
 def test_decode_dict_empty(self):
     self.assertEqual(decoder.decode_dict(b'de'), OrderedDict())
Example #4
0
 def test_decode_dict_cowmoospameggs(self):
     self.assertEqual(decoder.decode_dict(b'd3:cow3:moo4:spam4:eggse'), OrderedDict([(b'cow', b'moo'), (b'spam', b'eggs')]))
Example #5
0
 def test_decode_dict_duplicatekey_err(self):
     with self.assertRaises(decoder.DecodeError):
         decoder.decode_dict(b'd3:cowi123e3:cow4:spame')
Example #6
0
 def test_decode_dict_nesteddict(self):
     self.assertEqual(decoder.decode_dict(b'd3:cowd3:cowli123eeee'), OrderedDict([(b'cow', OrderedDict([(b'cow', [123])]))]))
Example #7
0
 def test_decode_dict_dictkey_err(self):
     with self.assertRaises(decoder.DecodeError):
         decoder.decode_dict(b'dd3:cowi123ee3:mooe')