def test_set_default_config_file_acount_config_does_not_exist( self, mock_exists, mock_config_path): paths = mock.Mock() paths.default_new_account_config.return_value = 'account-config' mock_config_path.return_value = paths mock_exists.return_value = False Config.set_default_config_file('account-name')
def __default(self): Config.set_default_config_file( account_name=self.command_args['--name'] ) log.info( 'Account %s has been set as default configuration', self.command_args['--name'] )
def test_set_default_config_file_exists_as_file(self, mock_islink, mock_exists, mock_config_path): paths = mock.Mock() paths.default_new_account_config.return_value = 'account-config' paths.default_config.return_value = 'default-config' mock_config_path.return_value = paths mock_exists.return_value = True mock_islink.return_value = False Config.set_default_config_file('account-name')
def test_set_default_config_file(self, mock_islink, mock_exists, mock_symlink, mock_remove, mock_config_path): paths = mock.Mock() paths.default_new_account_config.return_value = 'account-config' paths.default_config.return_value = None paths.default_new_config.return_value = 'default-config' mock_config_path.return_value = paths mock_exists.return_value = True mock_islink.return_value = True Config.set_default_config_file('account-name') mock_config_path.assert_called_once_with('account-name', None) mock_remove.assert_called_once_with('default-config') mock_symlink.assert_called_once_with('account-config', 'default-config')