-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tests] switch all pytest to unit tests
- Loading branch information
1 parent
e0c2f43
commit a8d4239
Showing
13 changed files
with
679 additions
and
655 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
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
Binary file not shown.
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 |
---|---|---|
@@ -1,13 +1,19 @@ | ||
from solid_dmft.io_tools import dict_to_h5 | ||
|
||
def test_prep_params_for_h5(): | ||
inp = {'a': None, 'b': {'c': None, 'd': 'e'}, 'f': [None, 'g']} | ||
expected = {'a': 'none', 'b': {'c': 'none', 'd': 'e'}, 'f': ['none', 'g']} | ||
import unittest | ||
|
||
assert dict_to_h5.prep_params_for_h5(inp) == expected | ||
class test_dict_to_h5(unittest.TestCase): | ||
def test_prep_params_for_h5(self): | ||
inp = {'a': None, 'b': {'c': None, 'd': 'e'}, 'f': [None, 'g']} | ||
expected = {'a': 'none', 'b': {'c': 'none', 'd': 'e'}, 'f': ['none', 'g']} | ||
|
||
def test_prep_params_from_h5(): | ||
inp = {'a': 'none', 'b': {'c': 'none', 'd': 'e'}, 'f': ['none', 'g']} | ||
expected = {'a': None, 'b': {'c': None, 'd': 'e'}, 'f': [None, 'g']} | ||
assert dict_to_h5.prep_params_for_h5(inp) == expected | ||
|
||
assert dict_to_h5.prep_params_from_h5(inp) == expected | ||
def test_prep_params_from_h5(self): | ||
inp = {'a': 'none', 'b': {'c': 'none', 'd': 'e'}, 'f': ['none', 'g']} | ||
expected = {'a': None, 'b': {'c': None, 'd': 'e'}, 'f': [None, 'g']} | ||
|
||
assert dict_to_h5.prep_params_from_h5(inp) == expected | ||
|
||
if __name__ == '__main__': | ||
unittest.main() |
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
Oops, something went wrong.