def test_respond_frame_csv(nav): x = nav.to_frame(name="Maffay") response = respond_pandas(x, "csv") f = pd.read_csv(StringIO(response.data.decode("utf-8")), index_col=0, header=0, parse_dates=True) pdt.assert_frame_equal(f, x, check_names=False)
def test_respond_json(): x = ["A", "B"] response = respond_pandas(x, "json") #print(response.data) assert json.loads(response.data) == ["A", "B"]
def json(): return respond_pandas(object=frame, format="json")
def test_respond_frame_json(nav): x = nav.to_frame(name="Maffay") response = respond_pandas(x, "json") pdt.assert_frame_equal( pd.read_json(response.data, typ="frame", orient="table"), x)
def csv(): return respond_pandas(object=frame, format="csv")