def test_bad_connect_string(self): """ Passing an un-parsable connect-endpoint-string is an error """ with ExpectedException(ValueError): magic_folder_migrate( self.temp.child("new_magic"), u"tcp:1234", self.node_dir.path, u"alice", "localhost:1234", )
def test_invalid_listen_string(self): """ Passing a non-string (bytes) for the listen-endpoint is an error """ with ExpectedException(ValueError): magic_folder_migrate( self.temp.child("new_magic"), b"1234", # only accepts unicode self.node_dir.path, u"alice", b"invalid", )
def test_bad_listen_string(self): """ Passing a completely invalid 'endpoint listen string' (not even a string) is an error """ with ExpectedException(CannotConvertEndpointError): magic_folder_migrate( self.temp.child("new_magic"), "1234", self.node_dir.path, u"alice", None, )
def test_good(self): magic_folder_migrate( self.temp.child("new_magic"), u"tcp:1234", self.node_dir.path, u"alice", u"tcp:localhost:1234", ) config = load_global_configuration(self.temp.child("new_magic")) self.assertThat( list(config.list_magic_folders()), Equals([u"test-folder"]), )