-
Notifications
You must be signed in to change notification settings - Fork 27
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 #531 from ACCESS-NRI/523-yatm-get-prior-retart-files
Override yatm model class method for prior restarts
- Loading branch information
Showing
2 changed files
with
27 additions
and
4 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,21 @@ | ||
|
||
from unittest.mock import Mock | ||
|
||
import payu.experiment | ||
import payu.models | ||
|
||
def test_get_prior_restart_files(capsys, tmpdir): | ||
with capsys.disabled(): | ||
expt = Mock(spec=payu.experiment.Experiment) | ||
model_config = {'model': 'yatm'} | ||
model = payu.models.Yatm(expt, 'atmosphere', model_config) | ||
model.prior_restart_path = str(tmpdir / 'unexistent_dir') | ||
|
||
restart_files = model.get_prior_restart_files() | ||
|
||
# Check nothing written to standard output | ||
captured = capsys.readouterr() | ||
assert captured.out == '' | ||
assert captured.err == '' | ||
|
||
assert restart_files == [] |