Skip to content

Commit

Permalink
fix(tests): fix UT
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBelthle committed Jun 14, 2024
1 parent e2a75ab commit ba00070
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/launcher/test_local_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import textwrap
import uuid
from pathlib import Path
from unittest.mock import Mock, call
from unittest.mock import Mock, call, patch

import pytest

Expand Down Expand Up @@ -39,7 +39,9 @@ def test_local_launcher__launcher_init_exception():


@pytest.mark.unit_test
def test_compute(tmp_path: Path, launcher_config: Config):
@patch("antarest.launcher.service.Path.iterdir")
# This is weird but needed for this unit test to run and avoid the FileNotFoundException.
def test_compute(mock, tmp_path: Path, launcher_config: Config):
local_launcher = LocalLauncher(launcher_config, callbacks=Mock(), event_bus=Mock(), cache=Mock())

# prepare a dummy executable to simulate Antares Solver
Expand Down Expand Up @@ -87,6 +89,7 @@ def test_compute(tmp_path: Path, launcher_config: Config):
study_uuid="study-id",
uuid=study_id,
launcher_parameters=launcher_parameters,
version="0",
)

# noinspection PyUnresolvedReferences
Expand Down

0 comments on commit ba00070

Please sign in to comment.