-
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.
- Loading branch information
1 parent
c1c8058
commit 6161e2e
Showing
1 changed file
with
26 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from argparse import Namespace | ||
from unittest.mock import patch | ||
from milex_scheduler.apps.milex_initialize import main | ||
import pytest | ||
import os | ||
|
||
|
||
@pytest.fixture | ||
def mock_parse_known_args(): | ||
with patch("argparse.ArgumentParser.parse_args") as mock_parse_known_args: | ||
mock_parse_known_args.return_value = Namespace(bundle_name="bundle_name") | ||
yield mock_parse_known_args | ||
|
||
|
||
@pytest.fixture | ||
def mock_load_config(tmp_path): | ||
mock_config = {"local": {"path": tmp_path}} | ||
os.makedirs(tmp_path / "jobs", exist_ok=True) | ||
with patch( | ||
"milex_scheduler.save_load_jobs.load_config", return_value=mock_config | ||
) as mock_load_config: | ||
yield mock_load_config | ||
|
||
|
||
def test_main(mock_parse_known_args, mock_load_config): | ||
main() | ||
Check failure on line 26 in tests/integration/test_milex_initialize.py GitHub Actions / build (3.10, ubuntu-latest)
Check failure on line 26 in tests/integration/test_milex_initialize.py GitHub Actions / build (3.10, macOS-latest)
Check failure on line 26 in tests/integration/test_milex_initialize.py GitHub Actions / build (3.10, ubuntu-latest)
|