@with_connectivity_check("http://www.google.com")
    def test_getdata(self):
        try:
            end_date = datetime.now()
            start_date = end_date - pd.offsets.Day() * 5
            end_date = end_date.strftime('%Y-%m-%d')
            start_date = start_date.strftime('%Y-%m-%d')

            reader = GAnalytics()
            df = reader.get_data(
                metrics=['avgTimeOnSite', 'visitors', 'newVisits',
                         'pageviewsPerVisit'],
                start_date=start_date,
                end_date=end_date,
                dimensions=['date', 'hour'],
                parse_dates={'ts': ['date', 'hour']},
                index_col=0)

            self.assertIsInstance(df, pd.DataFrame)
            self.assertIsInstance(df.index, pd.DatetimeIndex)
            self.assertGreater(len(df), 1)
            self.assertTrue('date' not in df)
            self.assertTrue('hour' not in df)
            self.assertEqual(df.index.name, 'ts')
            self.assertTrue('avgTimeOnSite' in df)
            self.assertTrue('visitors' in df)
            self.assertTrue('newVisits' in df)
            self.assertTrue('pageviewsPerVisit' in df)

            df2 = read_ga(
                metrics=['avgTimeOnSite', 'visitors', 'newVisits',
                         'pageviewsPerVisit'],
                start_date=start_date,
                end_date=end_date,
                dimensions=['date', 'hour'],
                parse_dates={'ts': ['date', 'hour']},
                index_col=0)

            assert_frame_equal(df, df2)

        except AuthenticationConfigError:
            raise nose.SkipTest("authentication error")
dataset/ETHPy150Open pydata/pandas/pandas/io/tests/test_ga.py/TestGoogle.test_getdata/original