]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
Add a test that a tree moved into the drop-upload directory is watched.
authorDaira Hopwood <daira@jacaranda.org>
Tue, 28 Apr 2015 12:44:09 +0000 (13:44 +0100)
committerDaira Hopwood <daira@jacaranda.org>
Tue, 28 Apr 2015 18:50:15 +0000 (19:50 +0100)
(It currently hangs because this case isn't handled correctly.)

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
src/allmydata/test/test_drop_upload.py

index b2eb1e48f30c2c6ea38f94711d57d06f327eb0fd..249b216c15aae72ad3de33fd3df2dc673f7dc1f4 100644 (file)
@@ -167,6 +167,19 @@ class DropUploadTestMixin(GridTestMixin, ShouldFailMixin, ReallyEqualMixin, NonA
         d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('drop_upload.files_uploaded'), 1))
         d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('drop_upload.objects_queued'), 0))
         d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('drop_upload.directories_created'), 2))
+
+        def testMovedTreeIsWatched(res):
+            d2 = defer.Deferred()
+            self.uploader.set_uploaded_callback(d2.callback, ignore_count=0)
+            fileutil.write(abspath_expanduser_unicode(u"another", base=new_small_tree_dir), "file")
+            self.notify_close_write(to_filepath(abspath_expanduser_unicode(u"another", base=new_small_tree_dir)))
+            return d2
+        d.addCallback(testMovedTreeIsWatched)
+        d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('drop_upload.objects_uploaded'), 4))
+        d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('drop_upload.files_uploaded'), 2))
+        d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('drop_upload.objects_queued'), 0))
+        d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('drop_upload.directories_created'), 2))
+
         d.addBoth(self._cleanup)
         return d