Exemplo n.º 1
0
 def test_parse(self):
     a = ('{"":""}', 0)
     self.assertRaises(TypeError, parse_object, None, *a)
     pi = {}
     self.assertRaises(KeyError, parse_object, pi, *a)
     pi['parse'] = parseloop
     pi['parsers'] = {}
     self.assertRaises(KeyError, parse_object, pi, *a)
     pi['parsers']['string'] = parse_string
     self.assertEqual(parse_object(pi, *a), (DeferredDict([('', '')]), 7))
Exemplo n.º 2
0
 def p(self, string, index=0):
     return parse_object(self.pinfo, string, index)