예제 #1
0
 def test_marshall_table(self):
     """Test streamlit.data_frame_proto._marshall_table."""
     proto = Table()
     data_frame_proto._marshall_table([[1, 2], [3, 4]], proto)
     ret = json.loads(json_format.MessageToJson(proto))
     ret = [x["int64s"]["data"] for x in ret["cols"]]
     truth = [["1", "2"], ["3", "4"]]
     self.assertEqual(ret, truth)
예제 #2
0
 def test_marshall_table(self):
     """Test streamlit.data_frame_proto._marshall_table."""
     proto = Table()
     data_frame_proto._marshall_table([[1, 2], [3, 4]], proto)
     ret = json.loads(json_format.MessageToJson(proto))
     ret = [x['int64s']['data'] for x in ret['cols']]
     truth = [['1', '2'], ['3', '4']]
     self.assertEqual(ret, truth)