Skip to content

Commit

Permalink
200 -> 302
Browse files Browse the repository at this point in the history
  • Loading branch information
rixth authored Jul 17, 2024
1 parent cf4e607 commit 0ed94f5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ async def test_ga_power_get_sc_web_token():
with patch(
"southern_company_api.parser.aiohttp.ClientSession.post"
) as mock_post, patch("src.southern_company_api.parser.jwt.decode"):
mock_post.return_value = MockResponse("", 200, "", ga_power_sample_sc_response)
mock_post.return_value = MockResponse("", 302, "", ga_power_sample_sc_response)
async with aiohttp.ClientSession() as session:
sca = SouthernCompanyAPI("", "", session)
sca._request_token = "sample"
Expand All @@ -99,7 +99,7 @@ async def test_get_sc_web_token_wrong_login():
with patch(
"src.southern_company_api.parser.aiohttp.ClientSession.post"
) as mock_post:
mock_post.return_value = MockResponse("", 200, "", {"statusCode": 500})
mock_post.return_value = MockResponse("", 302, "", {"statusCode": 500})
with pytest.raises(InvalidLogin):
await sca._get_sc_web_token()

Expand All @@ -112,7 +112,7 @@ async def test_ga_power_get_jwt_cookie():
"src.southern_company_api.parser.SouthernCompanyAPI.authenticate"
):
mock_post.return_value = MockResponse(
"", 200, ga_power_southern_jwt_cookie_header, ""
"", 302, ga_power_southern_jwt_cookie_header, ""
)
async with aiohttp.ClientSession() as session:
sca = SouthernCompanyAPI("", "", session)
Expand All @@ -131,7 +131,7 @@ async def test_ga_power_get_jwt():
) as mock_get_cookie, patch(
"src.southern_company_api.parser.jwt.decode"
):
mock_get.return_value = MockResponse("", 200, ga_power_jwt_header, "")
mock_get.return_value = MockResponse("", 302, ga_power_jwt_header, "")
mock_get_cookie.return_value.__aenter__.return_value = ""
async with aiohttp.ClientSession() as session:
sca = SouthernCompanyAPI("", "", session)
Expand All @@ -149,7 +149,7 @@ async def test_ga_power_get_accounts():
mock_get.return_value.__aenter__.return_value.json.return_value = (
ga_power_sample_account_response
)
mock_get.return_value.__aenter__.return_value.status = 200
mock_get.return_value.__aenter__.return_value.status = 302

@property
async def mock_jwt(_foo_self: SouthernCompanyAPI) -> str:
Expand All @@ -175,7 +175,7 @@ async def test_get_accounts_expired_jwt():
mock_get.return_value.__aenter__.return_value.json.return_value = (
ga_power_sample_account_response
)
mock_get.return_value.__aenter__.return_value.status = 200
mock_get.return_value.__aenter__.return_value.status = 302

async with aiohttp.ClientSession() as session:
sca = SouthernCompanyAPI("", "", session)
Expand Down

0 comments on commit 0ed94f5

Please sign in to comment.