'Test query into df for TestDataFrameClient object.'

def test_query_into_dataframe(self):

    data = {u'results': [{u'series': [{u'measurement': u'network', u'tags': {u'direction': u''}, u'columns': [u'time', u'value'], u'values': [[u'2009-11-10T23:00:00Z', 23422]]}, {u'measurement': u'network', u'tags': {u'direction': u'in'}, u'columns': [u'time', u'value'], u'values': [[u'2009-11-10T23:00:00Z', 23422], [u'2009-11-10T23:00:00Z', 23422], [u'2009-11-10T23:00:00Z', 23422]]}]}]}
    pd1 = pd.DataFrame([[23422]], columns=[u'value'], index=pd.to_datetime([u'2009-11-10T23:00:00Z']))
    pd1.index = pd1.index.tz_localize(u'UTC')
    pd2 = pd.DataFrame([[23422], [23422], [23422]], columns=[u'value'], index=pd.to_datetime([u'2009-11-10T23:00:00Z', u'2009-11-10T23:00:00Z', u'2009-11-10T23:00:00Z']))
    pd2.index = pd2.index.tz_localize(u'UTC')
    expected = {(u'network', ((u'direction', u''),)): pd1, (u'network', ((u'direction', u'in'),)): pd2}
    cli = DataFrameClient(u'host', 8086, u'username', u'password', u'db')
    with _mocked_session(cli, u'GET', 200, data):
        result = cli.query(u'select    value    from    network    group    by    direction;')
        for k in expected:
            assert_frame_equal(expected[k], result[k])
