-
Notifications
You must be signed in to change notification settings - Fork 3
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 #280 from neutrinoceros/tst/move_Parameters_tests
TST: move Parameters tests to dedicated module
- Loading branch information
Showing
3 changed files
with
25 additions
and
23 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,25 @@ | ||
import os | ||
import sys | ||
|
||
import pytest | ||
|
||
from nonos.api import Parameters | ||
|
||
|
||
def test_init_params_wo_a_file(tmp_path): | ||
os.chdir(tmp_path) | ||
with pytest.raises( | ||
FileNotFoundError, match=r"idefix.ini, pluto.ini, variables.par not found" | ||
): | ||
Parameters() | ||
|
||
|
||
@pytest.mark.skipif(sys.platform.startswith("win"), reason="does not run on windows") | ||
def test_config_dir_not_found(tmp_path): | ||
with pytest.raises(FileNotFoundError, match=r"not found"): | ||
Parameters(inifile="notafile", code="idefix", directory=tmp_path) | ||
|
||
|
||
def test_config_inifile_but_nocode(tmp_path): | ||
with pytest.raises(ValueError, match=r"both inifile and code have to be given"): | ||
Parameters(inifile="notafile", directory=tmp_path) |