-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support multiple paths in input_dir (#1000)
* Support multiple folder conventions in config-developer * Add documentation * Fix tests
- Loading branch information
Javier Vegas-Regidor
authored
Feb 15, 2021
1 parent
62a695f
commit 2204338
Showing
3 changed files
with
49 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
"""Tests for _replace_tags in _data_finder.py.""" | ||
|
||
from esmvalcore._data_finder import _replace_tags | ||
|
||
VARIABLE = { | ||
'short_name': 'tas', | ||
} | ||
|
||
|
||
def test_replace_tags_str(): | ||
assert _replace_tags('folder/subfolder/{short_name}', | ||
VARIABLE) == ['folder/subfolder/tas'] | ||
|
||
|
||
def test_replace_tags_list_of_str(): | ||
assert _replace_tags(('folder/subfolder/{short_name}', | ||
'folder2/{short_name}', 'subfolder/{short_name}'), | ||
VARIABLE) == [ | ||
'folder/subfolder/tas', | ||
'folder2/tas', | ||
'subfolder/tas', | ||
] |