Beispiel #1
0
    def test_get_fixtures(self):
        test_data = [{
            'id': 1,
            'attr1': 'value11',
            'attr2': 'value12'
        }, {
            'id': 2,
            'attr1': 'value21',
            'attr2': 'value22'
        }]

        fpl_mock = mock.MagicMock()

        @asyncio.coroutine
        def mock_get_fixtures(return_json):
            self.assertEqual(return_json, True)
            return test_data

        fpl_mock.get_fixtures = mock_get_fixtures

        fpl = FPLPandas(fpl=fpl_mock)
        actual_df = fpl.get_fixtures()
        expected_df = pd.DataFrame.from_dict(test_data).set_index('id')

        self.assertTrue(expected_df.equals(actual_df))
Beispiel #2
0
    def test_get_fixtures(self):
        log.info(f'Downloading fixtures ...')
        fpl = FPLPandas()
        fixtures = fpl.get_fixtures()
        log.info(f'Downloaded {fixtures.shape[0]} fixtures.')

        self.assertTrue(fixtures.shape[0] > 0)