Skip to content

Commit

Permalink
Correctly rename tests and module in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
madeddie committed May 16, 2024
1 parent 4399950 commit 4eb6aac
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tests/test_moocfi_cses.py → tests/test_tyora.py
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"


Expand All @@ -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:
Expand All @@ -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(
Expand All @@ -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(
Expand Down

0 comments on commit 4eb6aac

Please sign in to comment.