Layers Unittest: Hidden flag to quckly update diffs

This is not the commit you are looking for ...

This is not to be used lightly. But sometimes we change the name of the collections,
the initial value they have, ... and this helps to quickly update the tests.
This commit is contained in:
Dalai Felinto 2017-11-10 12:33:03 -02:00
parent 1122a401b0
commit 58a3057099
1 changed files with 6 additions and 0 deletions

View File

@ -159,6 +159,7 @@ def dump(data):
PDB = False
DUMP_DIFF = True
UPDATE_DIFF = False # HACK used to update tests when something change
def compare_files(file_a, file_b):
@ -172,6 +173,11 @@ def compare_files(file_a, file_b):
import subprocess
subprocess.call(["diff", "-u", file_a, file_b])
if UPDATE_DIFF:
import subprocess
subprocess.call(["cp", "-u", file_a, file_b])
if PDB:
import pdb
print("Files differ:", file_a, file_b)