Background
It is hard to update tests references for python tests
Solution
- Create new mode "-u" for api/tests/integration/test.py
- This mode will update the tests in "ref" folder for the executed tests
- If ref/$folder/$platform/$test exists, then update the test
- Create new function
compare_diff (filename, data, stdout=True, diff_fn=find_diff): str where
- filename - full file name
- data - text to read (update) from
- stdout - boolean to print into stdout (filename + ':SUCCEED' if no diff else filename + ":FAILED", then diff )
- diff_fn - lambda to compare two strings (find_diff(ref_txt, txt) by default)
- function should return None if no diff, or the diff string
- New function compare_diff should also use "-u"
- Find all places where "find_diff" is used and replace by compare_diff
- Move moleculeLayoutDiff and reactionLayoutDiff to util.py and use the -u parameter
Background
It is hard to update tests references for python tests
Solution
compare_diff (filename, data, stdout=True, diff_fn=find_diff): strwhere