1484
1484
self.startTest(check)
1485
1485
return self.deferred
1487
def test_SERVER_no_file(self):
1488
"""We just queued the Download, and it was interrupted."""
1489
# create the file in metadata
1490
path = os.path.join(self.share.path, "a")
1491
mdid = self.fsm.create(path, self.share.volume_id, is_dir=False, node_id="uuid")
1492
partial_path = os.path.join(self.fsm.partials_dir,
1493
mdid + ".u1partial." + os.path.basename(path))
1495
# this mimic Sync.get_file
1496
self.fsm.set_by_mdid(mdid, server_hash="blah-hash-blah")
1497
self.fsm.create_partial("uuid", self.share.volume_id)
1499
# now, for some reason, we lose the partial file
1500
os.remove(partial_path)
1503
"""arrange the metadata so later server_rescan will do ok"""
1504
self.assertEqual(self.eq.pushed, [])
1505
mdobj = self.fsm.get_by_mdid(mdid)
1506
self.assertFalse(mdobj.info.is_partial)
1507
self.assertEqual(mdobj.server_hash, mdobj.local_hash)
1509
self.startTest(check)
1510
return self.deferred
1487
1512
def test_SERVER_file_content(self):
1488
1513
"""We were downloading the file, but it was interrupted, and changed"""
1489
1514
# create the file in metadata