Skip to content

Commit

Permalink
Fix tests for refactored base_url
Browse files Browse the repository at this point in the history
  • Loading branch information
madeddie committed May 13, 2024
1 parent 106003e commit 83a9c0e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/test_moocfi_cses.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class TestParseForm:
)


# TODO: verify these mocked tests are actually accurate
# TODO: add tests for unreachable and failing endpoints, 4xx, 5xx, etc
@pytest.fixture
def mock_session() -> moocfi_cses.Session:
Expand All @@ -64,7 +63,7 @@ def test_login_successful(mock_session: moocfi_cses.Session) -> None:
# Mocking the HTTP response for successful login
with requests_mock.Mocker() as m:
m.get(
"https://example.com",
"https://example.com/list",
text='<a class="account" href="/user/1234">[email protected] (mooc.fi)</a>',
)
mock_session.login()
Expand All @@ -75,7 +74,7 @@ def test_login_failed(mock_session: moocfi_cses.Session) -> None:
# Mocking the HTTP response for failed login
with requests_mock.Mocker() as m:
m.get(
"https://example.com",
"https://example.com/list",
text='<a class="account" href="/login/oauth-redirect?site=mooc.fi">Login using mooc.fi</a>',
)
m.get("https://example.com/account", text="Login required")
Expand Down

0 comments on commit 83a9c0e

Please sign in to comment.