def test_wf_custom_types():

    @dataclass_json
    @dataclass
    class MyCustomType(object):
        x: int
        y: str

    @task
    def t1(a: int) -> MyCustomType:
        return MyCustomType(x=a, y='t1')

    @task
    def t2(a: MyCustomType, b: str) -> (MyCustomType, int):
        return (MyCustomType(x=a.x, y=f'{a.y} {b}'), 5)

    @workflow
    def my_wf(a: int, b: str) -> (MyCustomType, int):
        return t2(a=t1(a=a), b=b)
    (c, v) = my_wf(a=10, b='hello')
    assert (v == 5)
    assert (c.x == 10)
    assert (c.y == 't1 hello')
def test_wf_custom_types():

    @dataclass_json
    @dataclass
    class MyCustomType(object):
        x: int
        y: str

    @task
    def t1(a: int) -> MyCustomType:
        return MyCustomType(x=a, y='t1')

    @task
    def t2(a: MyCustomType, b: str) -> (MyCustomType, int):
        return (MyCustomType(x=a.x, y=f'{a.y} {b}'), 5)

    @workflow
    def my_wf(a: int, b: str) -> (MyCustomType, int):
        return t2(a=t1(a=a), b=b)
    (c, v) = my_wf(a=10, b='hello')
    assert (v == 5)
    assert (c.x == 10)
    assert (c.y == 't1 hello')