integration test for #2882

This commit is contained in:
meejah 2018-01-08 18:17:42 -07:00
parent 1171bf13af
commit 4f1735586d

View File

@ -1,8 +1,8 @@
import sys import sys
import time import time
import shutil import shutil
from os import mkdir, unlink, listdir from os import mkdir, unlink, listdir, utime
from os.path import join, exists from os.path import join, exists, getmtime
import util import util
@ -23,6 +23,22 @@ def test_alice_writes_bob_receives(magic_folder):
return 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): def test_bob_writes_alice_receives(magic_folder):
alice_dir, bob_dir = magic_folder alice_dir, bob_dir = magic_folder