def test_competition_result(self):
        mock_response = create_mock_json('tests/resources/list_competitions.json')
        competitions = mock_response.json().get('result')

        for competition in competitions:
            resource = resources.CompetitionResult(date_time_sent=self.DATE_TIME_SENT,
                                                   **competition)

            assert resource._datetime_sent == self.DATE_TIME_SENT
            assert resource.market_count == competition['marketCount']
            assert resource.competition_region == competition['competitionRegion']
            assert resource.competition.id == competition['competition']['id']
            assert resource.competition.name == competition['competition']['name']
    def test_competition_result(self):
        mock_response = create_mock_json('tests/resources/list_competitions.json')
        competitions = mock_response.json().get('result')

        for competition in competitions:
            resource = resources.CompetitionResult(elapsed_time=self.ELAPSED_TIME,
                                                   **competition)

            assert resource.elapsed_time == self.ELAPSED_TIME
            assert resource.market_count == competition['marketCount']
            assert resource.competition_region == competition['competitionRegion']
            assert resource.competition.id == competition['competition']['id']
            assert resource.competition.name == competition['competition']['name']
Example #3
0
    def test_competition_result(self):
        mock_response = create_mock_json(
            "tests/resources/list_competitions.json")
        competitions = mock_response.json().get("result")

        for competition in competitions:
            resource = resources.CompetitionResult(
                elapsed_time=self.ELAPSED_TIME, **competition)

            assert resource.elapsed_time == self.ELAPSED_TIME
            assert resource.market_count == competition["marketCount"]
            assert resource.competition_region == competition[
                "competitionRegion"]
            assert resource.competition.id == competition["competition"]["id"]
            assert resource.competition.name == competition["competition"][
                "name"]