Skip to content
Snippets Groups Projects
Commit decb1a2c authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

relax dump config tests

parent 75d22afc
Branches
Tags
1 merge request!144List available entry points in config-based click commands
Pipeline #61363 passed
......@@ -191,11 +191,15 @@ def _assert_config_dump(ref, ref_date):
# open(ref, 'wt').write(open('TEST_CONF').read())
with open("TEST_CONF", "r") as f, open(ref, "r") as f2:
text = f.read()
ref_text = f2.read().replace(ref_date, today)
# remove the starting whitespace of each line so the tests are more relaxed
text = "\n".join(line.lstrip() for line in text.splitlines())
ref_text = "\n".join(line.lstrip() for line in ref_text.splitlines())
assert text == ref_text
ref_text = f2.read()
ref_text = ref_text.replace(ref_date, today)
# remove the starting and final whitespace of each line so the tests are more relaxed
text = "\n".join(line.strip() for line in text.splitlines())
ref_text = "\n".join(line.strip() for line in ref_text.splitlines())
# replace ''' with """ so tests are more relaxed
text = text.replace("'''", '"""')
ref_text = ref_text.replace("'''", '"""')
assert text == ref_text
def test_config_dump():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment