-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from madeddie/add_subcommands
Rename some subcommands in line with tmc-cli
- Loading branch information
Showing
2 changed files
with
85 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|
@@ -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() | ||
|
@@ -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") | ||
|