def test_json_list(self): txt = df1.to_json(pretty=False) df2 = Table.from_json(txt) self.assertEqual(df2.columns, cols) self.assertEqual(df2.rowcnt, df1.rowcnt) self.assertEqual(df2['weight'].sum(), df1['weight'].sum())
def test_json_dict_pretty(self): txt = df1.to_json(as_dict=True, pretty=True) df2 = Table.from_json(txt) self.assertEqual(df2.columns, cols) self.assertEqual(df2.rowcnt, df1.rowcnt) self.assertEqual(df2['weight'].sum(), df1['weight'].sum())