-
-
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.
Correctly rename tests and module in tests
- Loading branch information
Showing
1 changed file
with
10 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import moocfi_cses | ||
import tyora | ||
import pytest | ||
import requests_mock | ||
|
||
|
||
def test_parse_args_missing_args() -> None: | ||
with pytest.raises(SystemExit): | ||
moocfi_cses.parse_args() | ||
tyora.parse_args() | ||
|
||
|
||
def test_parse_args_command() -> None: | ||
args = moocfi_cses.parse_args(["list"]) | ||
args = tyora.parse_args(["list"]) | ||
assert args.cmd == "list" | ||
|
||
|
||
|
@@ -26,15 +26,15 @@ class TestFindLink: | |
|
||
def test_find_link_success(self) -> None: | ||
assert ( | ||
moocfi_cses.find_link(self.valid_html, self.valid_xpath) | ||
tyora.find_link(self.valid_html, self.valid_xpath) | ||
== self.valid_return | ||
) | ||
|
||
def test_find_link_bad_xpath(self) -> None: | ||
assert moocfi_cses.find_link(self.valid_html, self.invalid_xpath) == {} | ||
assert tyora.find_link(self.valid_html, self.invalid_xpath) == {} | ||
|
||
def test_find_link_bad_html(self) -> None: | ||
assert moocfi_cses.find_link(self.invalid_html, self.valid_xpath) == {} | ||
assert tyora.find_link(self.invalid_html, self.valid_xpath) == {} | ||
|
||
|
||
class TestParseForm: | ||
|
@@ -51,15 +51,15 @@ class TestParseForm: | |
|
||
# TODO: add tests for unreachable and failing endpoints, 4xx, 5xx, etc | ||
@pytest.fixture | ||
def mock_session() -> moocfi_cses.Session: | ||
return moocfi_cses.Session( | ||
def mock_session() -> tyora.Session: | ||
return tyora.Session( | ||
username="[email protected]", | ||
password="test_password", | ||
base_url="https://example.com", | ||
) | ||
|
||
|
||
def test_login_successful(mock_session: moocfi_cses.Session) -> None: | ||
def test_login_successful(mock_session: tyora.Session) -> None: | ||
# Mocking the HTTP response for successful login | ||
with requests_mock.Mocker() as m: | ||
m.get( | ||
|
@@ -70,7 +70,7 @@ def test_login_successful(mock_session: moocfi_cses.Session) -> None: | |
assert mock_session.is_logged_in | ||
|
||
|
||
def test_login_failed(mock_session: moocfi_cses.Session) -> None: | ||
def test_login_failed(mock_session: tyora.Session) -> None: | ||
# Mocking the HTTP response for failed login | ||
with requests_mock.Mocker() as m: | ||
m.get( | ||
|