Last active
May 13, 2021 13:58
-
-
Save dz0/4d5ed838f85688a309a4ab1540b24853 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
from hamcrest import * | |
native = { | |
'runtime': { | |
'err': {'data validation': anything(), 'evaluation': anything()}, | |
}, | |
'schema': { | |
'sheet_names': {'err': {'missing': ['Loans']}}, | |
}, | |
'data': { | |
'info': {'info: planned repayment': anything(), 'info: factual repayment': anything()}, | |
}, | |
} | |
matcher = convert_nested_native_to_matcher(native) | |
# ==> | |
matcher = has_entries( | |
{ | |
'runtime': has_entries( | |
{ | |
'err': has_entries( | |
{'data validation': anything(), 'evaluation': anything()} | |
) | |
} | |
), | |
'schema': has_entries( | |
{'sheet_names': has_entries({'err': has_entries({'missing': contains_exactly('Loans')})})} | |
), | |
'data': has_entries( | |
{ | |
'info': has_entries( | |
{ | |
'info: planned repayment': anything(), | |
'info: factual repayment': anything(), | |
} | |
) | |
} | |
), | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment