Beispiel #1
0
 def test_racecard(self):
     rootdir = 'tests/resources/racecards'
     racecards = []
     for _, _, filenames in os.walk(rootdir):
         for json_racecard in [
                 fname for fname in filenames
                 if fname.startswith('racecards')
         ]:
             mock_response = create_mock_json(
                 os.path.join(rootdir, json_racecard))
             racecard = mock_response.json().get('result')
             racecards.append(
                 resources.RaceCard(date_time_sent=self.DATE_TIME_SENT,
                                    **racecard))
     assert 0 < len(racecards)
     assert all(
         isinstance(racecard, resources.RaceCard) for racecard in racecards)
 def test_racecard(self):
     mock_response = create_mock_json('tests/resources/racecard.json')
     racecard = mock_response.json().get('result')
     resource = resources.RaceCard(date_time_sent=self.DATE_TIME_SENT,
                                   **racecard)
     assert isinstance(resource, resources.RaceCard)