

def test_present_when_stage_exists_and_is_to_associate_to_existing_deployment(self):
    '\n        Tests scenario where we merely reassociate a stage to a pre-existing\n        deployments\n        '
    self.conn.get_rest_apis.return_value = apis_ret
    self.conn.get_deployment.return_value = deployment2_ret
    self.conn.get_deployments.return_value = deployments_ret
    self.conn.get_stage.return_value = stage1_deployment2_ret
    self.conn.update_stage.return_value = stage1_deployment1_ret
    self.conn.create_stage.side_effect = ClientError(error_content, 'create_stage')
    self.conn.create_deployment.side_effect = ClientError(error_content, 'create_deployment')
    result = {
        
    }
    with TempSwaggerFile() as swagger_file:
        result = salt_states['boto_apigateway.present']('api present', 'unit test api', swagger_file, 'test', False, 'arn:aws:iam::1234:role/apigatewayrole', **conn_parameters)
    self.assertTrue(result.get('publish'))
    self.assertIs(result.get('result'), True)
    self.assertFalse(result.get('abort'))
    self.assertTrue(result.get('changes', {
        
    }).get('new', [{
        
    }])[0])

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