

def test_absent_when_nuke_api_and_other_stages_deployments_exist(self):
    '\n        Tests scenario where the stagename exists and there are two stages associated with same deployment,\n        though nuke_api is requested, due to remaining deployments, we will not call the delete_rest_api call.\n        '
    self.conn.get_rest_apis.return_value = apis_ret
    self.conn.get_stage.return_value = stage1_deployment1_ret
    self.conn.delete_stage.return_value = {
        'ResponseMetadata': {
            'HTTPStatusCode': 200,
            'RequestId': '2d31072c-9d15-11e5-9977-6d9fcfda9c0a',
        },
    }
    self.conn.get_stages.return_value = stages_stage2_ret
    self.conn.get_deployments.return_value = deployments_ret
    self.conn.delete_rest_api.side_effect = ClientError(error_content, 'unexpected_api_delete')
    result = salt_states['boto_apigateway.absent']('api present', 'unit test api', 'test', nuke_api=True, **conn_parameters)
    self.assertIs(result.get('result'), True)
    self.assertIsNot(result.get('abort'), True)

dataset/ETHPy150Open saltstack/salt/tests/unit/states/boto_apigateway_test.py BotoApiGatewayTestCase.test_absent_when_nuke_api_and_other_stages_deployments_exist/original