def test_wf1():

    @task
    def t1(a: int) -> typing.NamedTuple('OutputsBC', t1_int_output=int, c=str):
        return ((a + 2), 'world')

    @task
    def t2(a: str, b: str) -> str:
        return (b + a)

    @workflow
    def my_wf(a: int, b: str) -> (int, str):
        (x, y) = t1(a=a)
        d = t2(a=y, b=b)
        return (x, d)
    assert (len(my_wf._nodes) == 2)
    assert (my_wf._nodes[0].id == 'n0')
    assert (my_wf._nodes[1]._upstream_nodes[0] is my_wf._nodes[0])
    assert (len(my_wf._output_bindings) == 2)
    assert (my_wf._output_bindings[0].var == 'o0')
    assert (my_wf._output_bindings[0].binding.promise.var == 't1_int_output')
    nt = typing.NamedTuple('SingleNT', t1_int_output=float)

    @task
    def t3(a: int) -> nt:
        return ((a + 2),)
    assert (t3.python_interface.output_tuple_name == 'SingleNT')
    assert (t3.interface.outputs['t1_int_output'] is not None)
def test_wf1():

    @task
    def t1(a: int) -> typing.NamedTuple('OutputsBC', t1_int_output=int, c=str):
        return ((a + 2), 'world')

    @task
    def t2(a: str, b: str) -> str:
        return (b + a)

    @workflow
    def my_wf(a: int, b: str) -> (int, str):
        (x, y) = t1(a=a)
        d = t2(a=y, b=b)
        return (x, d)
    assert (len(my_wf._nodes) == 2)
    assert (my_wf._nodes[0].id == 'n0')
    assert (my_wf._nodes[1]._upstream_nodes[0] is my_wf._nodes[0])
    assert (len(my_wf._output_bindings) == 2)
    assert (my_wf._output_bindings[0].var == 'o0')
    assert (my_wf._output_bindings[0].binding.promise.var == 't1_int_output')
    nt = typing.NamedTuple('SingleNT', t1_int_output=float)

    @task
    def t3(a: int) -> nt:
        return ((a + 2),)
    assert (t3.python_interface.output_tuple_name == 'SingleNT')
    assert (t3.interface.outputs['t1_int_output'] is not None)