diff --git a/tests/test_advise.py b/tests/test_advise.py index 6bb5d8a..d2e8e06 100644 --- a/tests/test_advise.py +++ b/tests/test_advise.py @@ -1,15 +1,12 @@ """Testing for the advise module""" -import pytest -from rich.console import Console from socket import timeout as SocketTimeout from unittest.mock import Mock, patch +import pytest + from execexam.advise import ( check_internet_connection, - check_advice_model, - check_advice_server, - enumerations, validate_url, ) @@ -38,37 +35,6 @@ def test_validate_url(): assert result -def test_check_advice_model_exit_on_none_model(): - """Test check_advice_model function with exit code""" - console = Console() - report = [enumerations.ReportType.testadvice] - advice_model = None - - # Expect a SystemExit to be raised - with pytest.raises(SystemExit) as exc_info: - check_advice_model(console, report, advice_model) - - # Assert exit code - assert exc_info.value.code == 1 - - -def test_check_advice_server_invalid_url(): - """Test that the function runs when server URL is invalid""" - console = Console() - report = [ - enumerations.ReportType.testadvice - ] # report indicating advice needed - advice_method = enumerations.AdviceMethod.api_server # set advice to API - advice_server = "invalid-url" # set invalid URL to create error - - # Expect SystemExit to be raised when server is called - with pytest.raises(SystemExit) as exc_info: - check_advice_server(console, report, advice_method, advice_server) - - # assert exit code - assert exc_info.value.code == 1 - - def test_check_internet_connection_success(): """Test that check_internet_connection returns True when connection is successful.""" with patch("socket.create_connection") as mock_create_connection: