Cleanup of _restart_client.
authorDaira Hopwood <daira@jacaranda.org>
Tue, 8 Sep 2015 14:26:15 +0000 (15:26 +0100)
committerDaira Hopwood <daira@jacaranda.org>
Wed, 30 Sep 2015 15:45:26 +0000 (16:45 +0100)
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
src/allmydata/test/test_magic_folder.py

index 7c21a087125144c94af900a652ea9745965fb5d5..4d4a0962707780f179d12e0ae27050465b266a91 100644 (file)
@@ -46,13 +46,14 @@ class MagicFolderTestMixin(MagicFolderCLITestMixin, ShouldFailMixin, ReallyEqual
     def _restart_client(self, ign):
         print "_restart_client"
         d = self.restart_client()
-        def _restarted(ign):
-            print "_restarted"
-            self.magicfolder = self.get_client().getServiceNamed('magic-folder')
-            return self.magicfolder.uploader.started_d
-        d.addCallback(_restarted)
+        d.addCallback(self._wait_until_started)
         return d
 
+    def _wait_until_started(self, ign):
+        print "_wait_until_started"
+        self.magicfolder = self.get_client().getServiceNamed('magic-folder')
+        return self.magicfolder.uploader.started_d
+
     def _create_magicfolder(self, ign):
         dbfile = abspath_expanduser_unicode(u"magicfolderdb.sqlite", base=self.basedir)
         self.magicfolder = MagicFolder(self.get_client(), self.upload_dircap, self.collective_dircap, self.local_dir,