Update dircondenser.py tool to update paths in test.json as well

Update dircondenser.py tool to update paths appearing in the expected
stdout in test.json when the containing directory is renamed.
This commit is contained in:
Jon Turney 2020-04-27 22:10:30 +01:00
parent 3cff11a75b
commit 630cfd84ad
No known key found for this signature in database
GPG Key ID: C7C86F0370285C81
1 changed files with 4 additions and 0 deletions

View File

@ -74,6 +74,10 @@ def condense(dirname: str):
#print('git mv "%s" "%s"' % (old_name, new_name))
subprocess.check_call(['git', 'mv', old_name, new_name])
replacements.append((old_name, new_name))
# update any appearances of old_name in expected stdout in test.json
json = os.path.join(new_name, 'test.json')
if os.path.isfile(json):
replace_source(json, [(old_name, new_name)])
os.chdir(curdir)
replace_source('run_unittests.py', replacements)
replace_source('run_project_tests.py', replacements)