def METHOD_NAME(infix, args, kwargs, should_be_tainted, prefix, suffix):
    from ddtrace.appsec.iast._taint_tracking import get_tainted_ranges
    from ddtrace.appsec.iast._taint_tracking import taint_pyobject
    import ddtrace.appsec.iast._taint_tracking.aspects as ddtrace_aspects
    if should_be_tainted:
        infix = taint_pyobject(
            pyobject=infix, source_name="test_decode_aspect", source_value=infix, source_origin=OriginType.PARAMETER
        )
    main_string = ddtrace_aspects.add_aspect(prefix, infix)
    if should_be_tainted:
        assert len(get_tainted_ranges(main_string))
    main_string = ddtrace_aspects.add_aspect(main_string, suffix)
    if should_be_tainted:
        assert len(get_tainted_ranges(main_string))
    ok, res = catch_all(ddtrace_aspects.encode_aspect, (main_string,) + args, kwargs)
    assert (ok, res) == catch_all(main_string.__class__.encode, (main_string,) + args, kwargs)
    if should_be_tainted and ok:
        list_ranges = get_tainted_ranges(res)
        assert len(list_ranges) == 1
        assert list_ranges[0].start == len(prefix.encode(*args, **kwargs))
        len_infix = len(infix.encode(*args, **kwargs))
        assert list_ranges[0].length == len_infix