ariatosca-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ARIA-34) API for rendering a downloaded resource
Date Thu, 05 Jan 2017 13:49:58 GMT

    [ https://issues.apache.org/jira/browse/ARIA-34?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15801390#comment-15801390
] 

ASF GitHub Bot commented on ARIA-34:
------------------------------------

Github user ran-z commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/41#discussion_r94769566
  
    --- Diff: tests/orchestrator/context/test_resource_render.py ---
    @@ -0,0 +1,73 @@
    +# Licensed to the Apache Software Foundation (ASF) under one or more
    +# contributor license agreements.  See the NOTICE file distributed with
    +# this work for additional information regarding copyright ownership.
    +# The ASF licenses this file to You under the Apache License, Version 2.0
    +# (the "License"); you may not use this file except in compliance with
    +# the License.  You may obtain a copy of the License at
    +#
    +#     http://www.apache.org/licenses/LICENSE-2.0
    +#
    +# Unless required by applicable law or agreed to in writing, software
    +# distributed under the License is distributed on an "AS IS" BASIS,
    +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +# See the License for the specific language governing permissions and
    +# limitations under the License.
    +
    +import pytest
    +
    +from tests import mock, storage
    +
    +_IMPLICIT_CTX_TEMPLATE = '{{ctx.deployment.name}}'
    +_IMPLICIT_CTX_TEMPLATE_PATH = 'implicit-ctx.template'
    +_VARIABLES_TEMPLATE = '{{variable}}'
    +_VARIABLES_TEMPLATE_PATH = 'variables.template'
    +
    +
    +def test_get_resource_and_render_implicit_ctx_no_variables(ctx):
    +    content = ctx.get_resource_and_render(_IMPLICIT_CTX_TEMPLATE_PATH)
    +    assert content == mock.models.DEPLOYMENT_NAME
    +
    +
    +def test_get_resource_and_render_provided_variables(ctx):
    +    variable = 'VARIABLE'
    +    content = ctx.get_resource_and_render(_VARIABLES_TEMPLATE_PATH,
    +                                          variables={'variable': variable})
    +    assert content == variable
    +
    +
    +def test_download_resource_and_render_implicit_ctx_no_variables(tmpdir, ctx):
    +    destination = tmpdir.join('destination')
    +    ctx.download_resource_and_render(destination=str(destination),
    +                                     path=_IMPLICIT_CTX_TEMPLATE_PATH)
    +    assert destination.read() == mock.models.DEPLOYMENT_NAME
    +
    +
    +def test_download_resource_and_render_provider_variables(tmpdir, ctx):
    --- End diff --
    
    typo (provided) :sweat_smile: 


> API for rendering a downloaded resource
> ---------------------------------------
>
>                 Key: ARIA-34
>                 URL: https://issues.apache.org/jira/browse/ARIA-34
>             Project: AriaTosca
>          Issue Type: Story
>            Reporter: Ran Ziv
>            Assignee: Dan Kilman
>
> Add an API for downloading + rendering a resource from the storage, similar to the workflow-context's
"download_resource" method



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message