add additional edge case to find models

This commit is contained in:
2025-10-23 09:45:15 +02:00
parent 1b44877980
commit 247f72cb51
2 changed files with 34 additions and 5 deletions

View File

@@ -56,8 +56,20 @@ def temp_model_folder_only_right(tmp_path_factory) -> Path:
@patch("dopt_sensor_anomalies._find_paths.STOP_FOLDER_NAME", "not-found")
def test_get_model_folder_Fail_NotFound():
with pytest.raises(FileNotFoundError):
def test_get_model_folder_Fail_NotFoundApplicationRoot():
with pytest.raises(
FileNotFoundError, match="application's root directory could not be determined"
):
_ = _find_paths.get_model_folder()
@patch("dopt_sensor_anomalies._find_paths.STOP_FOLDER_NAME", "lib")
@patch("dopt_sensor_anomalies._find_paths.MODEL_FOLDER_NAME", "not-found")
def test_get_model_folder_Fail_NotFoundModelFolder():
with pytest.raises(
FileNotFoundError,
match="model folder was not found in the application's root directory",
):
_ = _find_paths.get_model_folder()