Skip to content

Commit

Permalink
fix auth unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cwendt94 committed Sep 5, 2020
1 parent 96b91c5 commit 236bdc9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions tests/football/integration/test_league.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ def test_box_scores(self):

self.assertEqual(repr(box_scores[1].away_team), 'Team(TEAM BERRY)')
self.assertEqual(repr(box_scores[1].away_lineup[1]), 'Player(Odell Beckham Jr., points:29, projected:16)')
self.assertEqual(repr(box_scores[1]), 'Box Score(Team(TEAM BERRY) at Team(TEAM HOLLAND))')
Empty file added tests/requests/__init__.py
Empty file.
8 changes: 4 additions & 4 deletions tests/requests/test_espn_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class EspnRequestsTest(TestCase):

@requests_mock.Mocker()
@mock.patch('sys.stdout', new_callable=io.StringIO)
def test_authentication_api_fail(self, mock_request, mock_stdout, mock_fetch_league):
def test_authentication_api_fail(self, mock_request, mock_stdout):
url_api_key = 'https://registerdisney.go.com/jgc/v5/client/ESPN-FANTASYLM-PROD/api-key?langPref=en-US'
mock_request.post(url_api_key, status_code=400)
request = EspnFantasyRequests(sport='nfl', league_id=1234, year=2019)
Expand All @@ -16,7 +16,7 @@ def test_authentication_api_fail(self, mock_request, mock_stdout, mock_fetch_lea

@requests_mock.Mocker()
@mock.patch('sys.stdout', new_callable=io.StringIO)
def test_authentication_login_fail(self, mock_request, mock_stdout, mock_fetch_league):
def test_authentication_login_fail(self, mock_request, mock_stdout):
url_api_key = 'https://registerdisney.go.com/jgc/v5/client/ESPN-FANTASYLM-PROD/api-key?langPref=en-US'
url_login = 'https://ha.registerdisney.go.com/jgc/v5/client/ESPN-FANTASYLM-PROD/guest/login?langPref=en-US'
mock_request.post(url_api_key, headers={'api-key':'None'}, status_code=200)
Expand All @@ -28,7 +28,7 @@ def test_authentication_login_fail(self, mock_request, mock_stdout, mock_fetch_l

@requests_mock.Mocker()
@mock.patch('sys.stdout', new_callable=io.StringIO)
def test_authentication_login_error(self, mock_request, mock_stdout, mock_fetch_league):
def test_authentication_login_error(self, mock_request, mock_stdout):
url_api_key = 'https://registerdisney.go.com/jgc/v5/client/ESPN-FANTASYLM-PROD/api-key?langPref=en-US'
url_login = 'https://ha.registerdisney.go.com/jgc/v5/client/ESPN-FANTASYLM-PROD/guest/login?langPref=en-US'
mock_request.post(url_api_key, headers={'api-key':'None'}, status_code=200)
Expand All @@ -39,7 +39,7 @@ def test_authentication_login_error(self, mock_request, mock_stdout, mock_fetch_
self.assertEqual(mock_stdout.getvalue(), 'Authentication unsuccessful - error:{}\nRetry the authentication or continuing without private league access\n')

@requests_mock.Mocker()
def test_authentication_pass(self, mock_request, mock_fetch_league):
def test_authentication_pass(self, mock_request):
url_api_key = 'https://registerdisney.go.com/jgc/v5/client/ESPN-FANTASYLM-PROD/api-key?langPref=en-US'
url_login = 'https://ha.registerdisney.go.com/jgc/v5/client/ESPN-FANTASYLM-PROD/guest/login?langPref=en-US'
mock_request.post(url_api_key, headers={'api-key':'None'}, status_code=200)
Expand Down

0 comments on commit 236bdc9

Please sign in to comment.