From 729d70b1a53c289b89c48935922815961ba81781 Mon Sep 17 00:00:00 2001 From: Daira Hopwood Date: Thu, 3 Sep 2015 19:42:37 +0100 Subject: [PATCH] Add _restart_client callback. Signed-off-by: Daira Hopwood --- src/allmydata/test/test_magic_folder.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/allmydata/test/test_magic_folder.py b/src/allmydata/test/test_magic_folder.py index 9d4d6d73..fb75114e 100644 --- a/src/allmydata/test/test_magic_folder.py +++ b/src/allmydata/test/test_magic_folder.py @@ -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) -- 2.45.2