d.addCallback(_done)
return d
- def join(self, client_num, local_dir, invite_result):
- invite_code = result[1].strip()
+ def join(self, client_num, local_dir, invite_code):
magic_readonly_cap, dmd_write_cap = invite_code.split(magic_folder_cli.INVITE_SEPERATOR)
d = self.do_cli_n(client_num, "magic-folder", "join", invite_code, local_dir)
def _done((rc,stdout,stderr)):
self.failUnless(rc == 0)
return (rc,stdout,stderr)
d.addCallback(_done)
- d.addCallback(self.get_caps_from_files)
- d.addCallback(self.check_joined_config)
- d.addCallback(self.check_config)
+ def get_alice_caps(x):
+ alice_collective_dircap, alice_upload_dircap = self.get_caps_from_files(0)
+ d.addCallback(get_alice_caps)
+ d.addCallback(lambda x: self.check_joined_config(0, alice_upload_dircap))
+ d.addCallback(lambda x: self.check_config(1, alice_magic_dir))
return d
def cleanup(self, res):
self.basedir = "cli/MagicFolder/create-and-then-invite-join"
self.set_up_grid()
self.local_dir = os.path.join(self.basedir, "magic")
-
d = self.create_magic_folder(0)
- d.addCallback(self._invite)
- d.addCallback(self._join)
- d.addCallback(self.get_caps_from_files)
- d.addCallback(self.check_joined_config)
- d.addCallback(self.check_config)
+ d.addCallback(lambda x: self.invite(0, u"Alice"))
+ def get_invite((rc,stdout,stderr)):
+ self.invite_code = stdout.strip()
+ d.addCallback(get_invite)
+ d.addCallback(lambda x: self.join(0, self.local_dir, self.invite_code))
+ def get_caps(x):
+ self.collective_dircap, self.upload_dircap = self.get_caps_from_files(0)
+ d.addCallback(get_caps)
+ d.addCallback(lambda x: self.check_joined_config(0, self.upload_dircap))
+ d.addCallback(lambda x: self.check_config(0, self.local_dir))
return d
def test_create_invite_join(self):
self.failUnless(rc == 0)
return (rc,stdout,stderr)
d.addCallback(_done)
- d.addCallback(self.get_caps_from_files)
- d.addCallback(self.check_joined_config)
- d.addCallback(self.check_config)
+ def get_caps(x):
+ self.collective_dircap, self.upload_dircap = self.get_caps_from_files(0)
+ d.addCallback(get_caps)
+ d.addCallback(lambda x: self.check_joined_config(0, self.upload_dircap))
+ d.addCallback(lambda x: self.check_config(0, self.local_dir))
return d