-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(utils): add tests for relocated utilities
* add tests for grid and namefile utilities * stub tests for comparison and binary file utilities * mark get-modflow tests using GitHub API as slow * only skip test for generating classes from DFN if running in parallel
- Loading branch information
Showing
8 changed files
with
201 additions
and
52 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 @@ | ||
import os | ||
|
||
import pytest | ||
from autotest.conftest import excludes_branch, get_project_root_path | ||
|
||
from flopy.mf6.utils import generate_classes | ||
|
||
|
||
_project_root_path = get_project_root_path() | ||
_using_xdist = bool(os.environ.get("PYTEST_XDIST_WORKER", None)) | ||
|
||
|
||
@excludes_branch("master") | ||
@pytest.mark.mf6 | ||
@pytest.mark.skipif(_using_xdist, reason="modifies and reverts repository files, can't be run in parallel") | ||
def test_generate_classes_from_dfn(): | ||
try: | ||
generate_classes(branch="develop", backup=False) | ||
finally: | ||
paths = [ | ||
_project_root_path / "flopy" / "mf6" / "data" / "dfn", | ||
_project_root_path / "flopy" / "mf6" / "modflow" | ||
] | ||
# restoring might lose work if these files have been modified | ||
for path in paths: | ||
os.system(f"git restore {path}") |
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,39 @@ | ||
import pytest | ||
|
||
pytestmark = pytest.mark.skip(reason="todo") | ||
|
||
|
||
def test_calculate_diffmax(): | ||
pass | ||
|
||
|
||
def test_calculate_difftol(): | ||
pass | ||
|
||
|
||
def test_eval_bud_diff(): | ||
pass | ||
|
||
|
||
def test_compare_budget(): | ||
pass | ||
|
||
|
||
def test_compare_swrbudget(): | ||
pass | ||
|
||
|
||
def test_compare_heads(): | ||
pass | ||
|
||
|
||
def test_compare_concs(): | ||
pass | ||
|
||
|
||
def test_compare_stages(): | ||
pass | ||
|
||
|
||
def test_compare(): | ||
pass |
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
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,34 @@ | ||
import pytest | ||
from autotest.conftest import get_example_data_path | ||
from flopy.utils.mfreadnam import get_entries_from_namefile | ||
|
||
_example_data_path = get_example_data_path() | ||
|
||
|
||
@pytest.mark.parametrize("path", [ | ||
_example_data_path / "mf6" / "test001a_Tharmonic" / "mfsim.nam", | ||
_example_data_path / "mf6" / "test001e_UZF_3lay" / "mfsim.nam", | ||
_example_data_path / "mf6-freyberg" / "mfsim.nam", | ||
]) | ||
def test_get_entries_from_namefile_mf6(path): | ||
package = "IMS6" | ||
entries = get_entries_from_namefile(path, ftype=package) | ||
assert len(entries) == 1 | ||
|
||
entry = entries[0] | ||
assert path.parent.name in entry[0] | ||
assert entry[1] == package | ||
|
||
|
||
@pytest.mark.skip(reason="only supports mf6 namefiles") | ||
@pytest.mark.parametrize("path", [ | ||
_example_data_path / "mf6-freyberg" / "freyberg.nam", | ||
]) | ||
def test_get_entries_from_namefile_mf2005(path): | ||
package = "IC6" | ||
entries = get_entries_from_namefile(path, ftype=package) | ||
assert len(entries) == 1 | ||
|
||
entry = entries[0] | ||
assert path.parent.name in entry[0] | ||
assert entry[1] == package |
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