Ejemplo n.º 1
0
def test_conversion_wrapper():
    assert ConversionWrapper(c.item(1)).execute([0, 10]) == 10
    assert (ConversionWrapper(
        ConversionWrapper(
            NamedConversion(
                "abc",
                NamedConversion("foo", c.item()) + c.item(),
            ) + c.item(),
            name_to_code_input={"foo": "arg_foo2"},
        ),
        name_to_code_input={
            "abc": "arg_abc",
            "foo": "arg_foo"
        },
    )).gen_converter(
        debug=False,
        signature="data_, arg_abc=10, arg_foo=20, arg_foo2=30")(1) == 41
Ejemplo n.º 2
0
def test_named_conversion():
    assert NamedConversion("abc", c.item(0)).execute([1]) == 1