Ensure that errors from Alice-and-Bob tests are reported correctly if setup fails.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
Daira Hopwood 2015-10-20 21:37:05 +01:00
parent fadd2049bb
commit b5b301707b
2 changed files with 7 additions and 16 deletions

View File

@ -126,6 +126,9 @@ class MagicFolderCLITestMixin(CLITestMixin, GridTestMixin):
def setup_alice_and_bob(self, alice_clock=reactor, bob_clock=reactor):
self.set_up_grid(num_clients=2)
self.alice_magicfolder = None
self.bob_magicfolder = None
alice_magic_dir = abspath_expanduser_unicode(u"Alice-magic", base=self.basedir)
self.mkdir_nonascii(alice_magic_dir)
bob_magic_dir = abspath_expanduser_unicode(u"Bob-magic", base=self.basedir)
@ -168,12 +171,6 @@ class MagicFolderCLITestMixin(CLITestMixin, GridTestMixin):
bob_magic_dir, bob_clock)
return result
d.addCallback(get_Bob_magicfolder)
def prepare_result(result):
# XXX improve this
return (self.alice_collective_dircap, self.alice_upload_dircap, self.alice_magicfolder,
self.bob_collective_dircap, self.bob_upload_dircap, self.bob_magicfolder)
d.addCallback(prepare_result)
return d

View File

@ -339,13 +339,6 @@ class MagicFolderTestMixin(MagicFolderCLITestMixin, ShouldFailMixin, ReallyEqual
alice_clock = task.Clock()
bob_clock = task.Clock()
d = self.setup_alice_and_bob(alice_clock, bob_clock)
def get_results(result):
# XXX are these used?
(self.alice_collective_dircap, self.alice_upload_dircap, self.alice_magicfolder,
self.bob_collective_dircap, self.bob_upload_dircap, self.bob_magicfolder) = result
#print "Alice magicfolderdb is at %r" % (self.alice_magicfolder._client.basedir)
#print "Bob magicfolderdb is at %r" % (self.bob_magicfolder._client.basedir)
d.addCallback(get_results)
def _check_uploader_count(ign, name, expected):
self.failUnlessReallyEqual(self._get_count('uploader.'+name, client=self.alice_magicfolder._client),
@ -425,6 +418,7 @@ class MagicFolderTestMixin(MagicFolderCLITestMixin, ShouldFailMixin, ReallyEqual
d.addCallback(_check_downloader_count, 'objects_downloaded', 3)
def _cleanup(ign, magicfolder, clock):
if magicfolder is not None:
d2 = magicfolder.finish()
clock.advance(0)
return d2