def METHOD_NAME(self):
    self.mock_elasticbeanstalk.create_environment.side_effect = [
        InvalidParameterValueError('DNS name (cname) is not available.'),
    ]
    try:
        env_request = CreateEnvironmentRequest(
            app_name='app-name',
            env_name='env-name',
            )
        createops.create_env(env_request, interactive=False)
        self.fail('Should have thrown InvalidParameterValueError')
    except InvalidParameterValueError:
        pass