Add _restart_client callback.
authorDaira Hopwood <daira@jacaranda.org>
Thu, 3 Sep 2015 18:42:37 +0000 (19:42 +0100)
committerDaira Hopwood <daira@jacaranda.org>
Tue, 15 Sep 2015 17:42:59 +0000 (18:42 +0100)
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
src/allmydata/test/test_magic_folder.py

index 9d4d6d736d244ec063a149b7a523651eb3c81cef..fb75114e5a2096bb6f057294054eb5c497394158 100644 (file)
@@ -42,6 +42,19 @@ class MagicFolderTestMixin(MagicFolderCLITestMixin, ShouldFailMixin, ReallyEqual
         self.failUnlessEqual(bdb.VERSION, 3)
         return bdb
 
+    def _restart_client(self, ign):
+        print "_restart_client"
+        d = self.restart_client()
+        def _restarted(ign):
+            print "_restarted"
+            self.client = self.get_client()
+            print self.client
+            print self.client.services
+            self.magicfolder = self.client.getServiceNamed('magic-folder')
+            #self.magicfolder.ready()
+        d.addCallback(_restarted)
+        return d
+
     def _create_magicfolder(self, ign):
         dbfile = abspath_expanduser_unicode(u"magicfolderdb.sqlite", base=self.basedir)
         self.magicfolder = MagicFolder(self.client, self.upload_dircap, self.collective_dircap, self.local_dir,
@@ -95,7 +108,7 @@ class MagicFolderTestMixin(MagicFolderCLITestMixin, ShouldFailMixin, ReallyEqual
         self.stats_provider = self.client.stats_provider
 
         d = self.create_invite_join_magic_folder(u"Alice", self.local_dir)
-        d.addCallback(self._create_magicfolder)
+        d.addCallback(self._restart_client)
 
         d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('uploader.dirs_monitored'), 1))
         d.addBoth(self.cleanup)