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)
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
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),
d.addCallback(_check_downloader_count, 'objects_downloaded', 3)
def _cleanup(ign, magicfolder, clock):
- d2 = magicfolder.finish()
- clock.advance(0)
- return d2
+ if magicfolder is not None:
+ d2 = magicfolder.finish()
+ clock.advance(0)
+ return d2
def cleanup_Alice_and_Bob(result):
print "cleanup alice bob test\n"