-
Notifications
You must be signed in to change notification settings - Fork 35
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
c798daa
commit adaa752
Showing
3 changed files
with
38 additions
and
105 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
|
||
from message_ix_models import testing | ||
from message_ix_models.testing import bare_res | ||
|
||
from message_ix_models.model.water.build import build, get_spec, | ||
|
||
|
||
|
||
|
||
def test_build(request, test_context): | ||
scenario = testing.bare_res(request, test_context) | ||
|
||
# Code runs on the bare RES | ||
build(scenario) | ||
|
||
# New set elements were added | ||
assert "extract_surfacewater" in scenario.set("technology").tolist() | ||
|
||
|
||
def test_get_spec(session_context): | ||
# Code runs | ||
spec = get_spec() | ||
|
||
# Expected return type | ||
assert isinstance(spec, dict) and len(spec) == 3 | ||
|
||
# Contents are read correctly | ||
assert "water_supply" in spec["require"].set["level"] | ||
|
||
|
||
|
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