]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
Add test for Bob download callback
authorDavid Stainton <dstainton415@gmail.com>
Tue, 30 Jun 2015 23:03:28 +0000 (16:03 -0700)
committerDaira Hopwood <daira@jacaranda.org>
Tue, 15 Sep 2015 16:56:00 +0000 (17:56 +0100)
src/allmydata/test/test_magic_folder.py

index 190b19180639129bc814c7367480204cab07e614..59ef855c1d32039182e002833b78b439e21d91ef 100644 (file)
@@ -333,14 +333,24 @@ class MagicFolderTestMixin(MagicFolderCLITestMixin, ShouldFailMixin, ReallyEqual
             self.alice_magicfolder.set_processed_callback(d2.callback, ignore_count=0)
             return d2
         d.addCallback(wait_for_upload)
-        def prepare_for_stats(result):
+        def prepare_for_alice_stats(result):
             self.stats_provider = self.alice_magicfolder._client.stats_provider
-        d.addCallback(prepare_for_stats)
+        d.addCallback(prepare_for_alice_stats)
         d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('magic_folder.objects_succeeded'), 1))
         d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('magic_folder.files_uploaded'), 1))
         d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('magic_folder.objects_queued'), 0))
         d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('magic_folder.directories_created'), 0))
 
+        def wait_for_download(result):
+            d2 = defer.Deferred()
+            self.bob_magicfolder.set_download_callback(d2.callback, ignore_count=0)
+            return d2
+        d.addCallback(wait_for_download)
+        def prepare_for_bob_stats(result):
+            self.stats_provider = self.bob_magicfolder._client.stats_provider
+        d.addCallback(prepare_for_bob_stats)
+        d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('magic_folder.objects_succeeded'), 1))
+
         def cleanup_Alice_and_Bob(result):
             d = defer.succeed(None)
             d.addCallback(lambda ign: self.alice_magicfolder.finish(for_tests=True))