diff --git a/integration/test_smoke.py b/integration/test_smoke.py index dece02bc9..9226bb385 100644 --- a/integration/test_smoke.py +++ b/integration/test_smoke.py @@ -1,8 +1,8 @@ import sys import time import shutil -from os import mkdir, unlink, listdir -from os.path import join, exists +from os import mkdir, unlink, listdir, utime +from os.path import join, exists, getmtime import util @@ -23,6 +23,22 @@ def test_alice_writes_bob_receives(magic_folder): return +def test_alice_writes_bob_receives_old_timestamp(magic_folder): + alice_dir, bob_dir = magic_folder + fname = join(alice_dir, "ts_file") + ts = time.time() - (60 * 60 * 36) # 36 hours ago + + with open(fname, "w") as f: + f.write("alice wrote this") + utime(fname, (time.time(), ts)) + + fname = join(bob_dir, "ts_file") + util.await_file_contents(fname, "alice wrote this") + # make sure the timestamp is correct + assert int(getmtime(fname)) == int(ts) + return + + def test_bob_writes_alice_receives(magic_folder): alice_dir, bob_dir = magic_folder