def test_news(self): uri_path = "{base_url}/News?key={api_key}".format( base_url=self.mock_news_client._base_url, api_key=TEST_API_KEY) response_body = load_json(os.path.join(NEWS_DIR, "news_response.json")) responses.add(responses.GET, uri_path, status=200, body=json.dumps(response_body), content_type="application/json") res = self.mock_news_client.news() nose.tools.assert_equal(res.status_code, 200) nose.tools.assert_equals(res.json(), response_body)
def test_player_props_by_date(self): uri_path = "{base_url}/PlayerPropsByDate/{date}?key={api_key}".format( base_url=self.mock_odds_client._base_url, date=TEST_DATE, api_key=TEST_API_KEY) response_body = load_json( os.path.join(ODDS_DIR, "player_props_by_date_response.json")) responses.add(responses.GET, uri_path, status=200, body=json.dumps(response_body), content_type="application/json") res = self.mock_odds_client.player_props_by_date(TEST_DATE) nose.tools.assert_equal(res.status_code, 200) nose.tools.assert_equals(res.json(), response_body)
def test_ingame_odds_line_movement(self): uri_path = "{base_url}/InGameOddsLineMovement/{game_id}?key={api_key}".format( base_url=self.mock_odds_client._base_url, game_id=TEST_GAME_ID, api_key=TEST_API_KEY) response_body = load_json( os.path.join(ODDS_DIR, "ingame_odds_movement_response.json")) responses.add(responses.GET, uri_path, status=200, body=json.dumps(response_body), content_type="application/json") res = self.mock_odds_client.ingame_odds_line_movement(TEST_GAME_ID) nose.tools.assert_equal(res.status_code, 200) nose.tools.assert_equals(res.json(), response_body)
def test_premium_news_by_player(self): uri_path = "{base_url}/PremiumNewsByPlayerID/{player_id}?key={api_key}".format( base_url=self.mock_news_client._premium_url, player_id=TEST_PLAYER_ID, api_key=TEST_API_KEY) response_body = load_json( os.path.join(NEWS_DIR, "premium_news_by_player_response.json")) responses.add(responses.GET, uri_path, status=200, body=json.dumps(response_body), content_type="application/json") res = self.mock_news_client.premium_news_by_player(TEST_PLAYER_ID) nose.tools.assert_equal(res.status_code, 200) nose.tools.assert_equals(res.json(), response_body)
def test_rotoballer_articles_by_date(self): uri_path = "{base_url}/RotoBallerArticlesByDate/{date}?key={api_key}".format( base_url=self.mock_news_client._rotoballer_url, date=TEST_DATE, api_key=TEST_API_KEY) response_body = load_json( os.path.join(NEWS_DIR, "rotoballer_articles_by_date_response.json")) responses.add(responses.GET, uri_path, status=200, body=json.dumps(response_body), content_type="application/json") res = self.mock_news_client.rotoballer_articles_by_date(TEST_DATE) nose.tools.assert_equal(res.status_code, 200) nose.tools.assert_equals(res.json(), response_body)