diff --git a/tests/helpers.py b/tests/helpers.py index 7c7a0c7..2d4c6d6 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -58,10 +58,7 @@ def clean(path): def edit_file(path, newcontent): - if not os.path.exists(path): - write_to_file(path, newcontent) - else: - write_to_file(path, newcontent) + return write_to_file(path, newcontent) def unix_tree(path): diff --git a/tests/test_update.py b/tests/test_update.py index 7e33c8e..ea05b33 100644 --- a/tests/test_update.py +++ b/tests/test_update.py @@ -42,7 +42,8 @@ class TestIndexing(unittest.TestCase): d1f2 = create_rnd_file(d1, 'dir1file2') d2f1 = create_rnd_file(d2, 'dir2file1') - noder = Noder() + noder = Noder(debug=True) + noder.set_hashing(True) top = noder.new_top_node() catalog = Catalog(catalogpath, force=True, debug=False) @@ -92,6 +93,7 @@ class TestIndexing(unittest.TestCase): maccess = os.path.getmtime(f4) EDIT = 'edited' edit_file(f4, EDIT) + # reset edit time os.utime(f4, (maccess, maccess)) f4_md5_new = md5sum(d1f1)