Пример #1
0
 def test_parse(self):
     a = ('[1]', 0)
     self.assertRaises(TypeError, parse_array, None, *a)
     pi = {}
     self.assertRaises(KeyError, parse_array, pi, *a)
     pi['parse'] = NotImplemented
     self.assertRaises(TypeError, parse_array, pi, *a)
     pi['parse'] = parseloop
     pi['parsers'] = {'array': parse_array}
     self.assertEqual(parse_array(pi, '[]', 0), (dlist(), 2))
Пример #2
0
 def p(self, string, index=0):
     return parse_array(self.pinfo, string, index)