def test_simple(self): data = self.basic_data #data = ["hello", 5, 5.5, []] for value in data: enc = json.dumps(value) chk = parse(enc) self.assertEqual(chk, value)
def test_bare(self): data = self.bare_data for enc, value in data: chk = parse(enc) self.assertEqual(chk, value)
def test_bad_data(self): data = self.bad_data for enc in data: with self.assertRaises(ValueError): chk = parse(enc)
def test_escape(self): data = self.escape_data for enc in data: value = json.loads(enc) chk = parse(enc) self.assertEqual(chk, value)
def test_unclosed(self): data = self.unclosed_data for enc in data: with self.assertRaises(ValueError): chk = parse(enc)
def test_implicit_join(self): data = self.join_data for enc, value in data: chk = parse(enc) self.assertEqual(chk, value)
def test_comments(self): data = self.comment_data for enc, value in data: chk = parse(enc) self.assertEqual(chk, value)