

def testReadObject(self):
    stream = StringIO('{"key1":[0,1,2,3,4,{"value":"5"}], "key2":            {"key1":[0,1,2,3,4,{"value":"5"}]}}')
    reader = pulljson.JSONPullParser(stream)
    obj = reader.readObject()
    self.assertEqual(len(obj), 2)
    for i in range(0, 2):
        self.assertEqual(len(obj['key1']), 6)
        for i in range(0, 5):
            self.assertEqual(obj['key1'][i], i)
        self.assertEqual(obj['key1'][5]['value'], '5')
        if (i == 1):
            obj = obj['key2']
            self.assertEqual(len(obj), 1)

dataset/ETHPy150Open Teradata/PyTd/test/test_pulljson.py TestJSONPullParser.testReadObject/original