Ejemplo n.º 1
0
    def test_otherwise(self):
        obj = structures.IfPresentPlaceholderStructure(
            then='then', input_name='input_name', otherwise=['something'])
        self.assertEqual(obj.otherwise, ['something'])

        obj = structures.IfPresentPlaceholderStructure(
            then='then', input_name='input_name', otherwise=[])
        self.assertEqual(obj.otherwise, None)
Ejemplo n.º 2
0
    name: component_if
    """)

COMPONENT_SPEC_IF_PLACEHOLDER = structures.ComponentSpec(
    name='component_if',
    implementation=structures.Implementation(
        container=structures.ContainerSpec(
            image='alpine',
            args=[
                structures.IfPresentPlaceholder(
                    if_structure=structures.IfPresentPlaceholderStructure(
                        input_name='optional_input_1',
                        then=[
                            '--arg1',
                            structures.InputUriPlaceholder(
                                input_name='optional_input_1'),
                        ],
                        otherwise=[
                            '--arg2',
                            'default',
                        ]))
            ])),
    inputs={
        'optional_input_1': structures.InputSpec(type='String', default=None)
    },
)

V1_YAML_CONCAT_PLACEHOLDER = textwrap.dedent("""\
    name: component_concat
    implementation:
      container: