def test_that_when_updating_a_trail_fails_the_update_trail_method_returns_error(self): ''' tests False trail not updated. ''' self.conn.update_trail.side_effect = ClientError(error_content, 'update_trail') result = boto_cloudtrail.update(Name=trail_ret['Name'], S3BucketName=trail_ret['S3BucketName'], **conn_parameters) self.assertEqual(result.get('error', {}).get('message'), error_message.format('update_trail'))
def test_that_when_updating_a_trail_succeeds_the_update_trail_method_returns_true(self): ''' tests True trail updated. ''' self.conn.update_trail.return_value = trail_ret result = boto_cloudtrail.update(Name=trail_ret['Name'], S3BucketName=trail_ret['S3BucketName'], **conn_parameters) self.assertTrue(result['updated'])
def test_that_when_updating_a_trail_succeeds_the_update_trail_method_returns_true( self, ): """ tests True trail updated. """ self.conn.update_trail.return_value = trail_ret result = boto_cloudtrail.update(Name=trail_ret["Name"], S3BucketName=trail_ret["S3BucketName"], **conn_parameters) self.assertTrue(result["updated"])
def test_that_when_updating_a_trail_fails_the_update_trail_method_returns_error( self, ): """ tests False trail not updated. """ self.conn.update_trail.side_effect = ClientError( error_content, "update_trail") result = boto_cloudtrail.update(Name=trail_ret["Name"], S3BucketName=trail_ret["S3BucketName"], **conn_parameters) assert result.get( "error", {}).get("message") == error_message.format("update_trail")