-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #109 from rl-institut/fix/startup
Change startup to ease user experience of the tool
- Loading branch information
Showing
6 changed files
with
37 additions
and
11 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
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
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
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,4 @@ | ||
from mvs_eland_tool.mvs_eland_tool import main | ||
|
||
if __name__ == "__main__": | ||
main() |
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 |
---|---|---|
|
@@ -5,3 +5,4 @@ graphviz==0.13 | |
sphinx==2.2.2 | ||
coverage==4.5 | ||
python-coveralls==2.9.3 | ||
mock==3.0.5 |
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 |
---|---|---|
@@ -1,9 +1,30 @@ | ||
import pytest | ||
import os | ||
import sys | ||
import argparse | ||
import shutil | ||
import mock | ||
import pytest | ||
|
||
from mvs_eland_tool.mvs_eland_tool import main | ||
|
||
OUTPUT_PATH = os.path.join(".", "tests", "MVS_outputs_simulation") | ||
|
||
|
||
def setup_module(): | ||
if os.path.exists(OUTPUT_PATH): | ||
shutil.rmtree(OUTPUT_PATH, ignore_errors=True) | ||
|
||
def test_run_smoothly(): | ||
# Ensure that code does not terminate | ||
|
||
# this ensure that the test is only ran if explicitly executed, ie not when the `pytest` command | ||
# alone it called | ||
@pytest.mark.skipif( | ||
"tests/test_simulation.py" not in sys.argv, reason="requires python3.3" | ||
) | ||
@mock.patch("argparse.ArgumentParser.parse_args", return_value=argparse.Namespace()) | ||
def test_run_smoothly(mock_args): | ||
main(path_output_folder=OUTPUT_PATH) | ||
assert 1 == 1 | ||
|
||
|
||
def teardown_module(): | ||
shutil.rmtree(OUTPUT_PATH, ignore_errors=True) |