# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ..preprocess import Retroicor


def test_Retroicor_inputs():
    input_map = dict(
        args=dict(
            argstr="%s",
        ),
        card=dict(
            argstr="-card %s",
            extensions=None,
            position=-2,
        ),
        cardphase=dict(
            argstr="-cardphase %s",
            extensions=None,
            hash_files=False,
            position=-6,
        ),
        environ=dict(
            nohash=True,
            usedefault=True,
        ),
        in_file=dict(
            argstr="%s",
            copyfile=False,
            extensions=None,
            mandatory=True,
            position=-1,
        ),
        num_threads=dict(
            nohash=True,
            usedefault=True,
        ),
        order=dict(
            argstr="-order %s",
            position=-5,
        ),
        out_file=dict(
            argstr="-prefix %s",
            extensions=None,
            name_source=["in_file"],
            name_template="%s_retroicor",
            position=1,
        ),
        outputtype=dict(),
        resp=dict(
            argstr="-resp %s",
            extensions=None,
            position=-3,
        ),
        respphase=dict(
            argstr="-respphase %s",
            extensions=None,
            hash_files=False,
            position=-7,
        ),
        threshold=dict(
            argstr="-threshold %d",
            position=-4,
        ),
    )
    inputs = Retroicor.input_spec()

    for key, metadata in list(input_map.items()):
        for metakey, value in list(metadata.items()):
            assert getattr(inputs.traits()[key], metakey) == value


def test_Retroicor_outputs():
    output_map = dict(
        out_file=dict(
            extensions=None,
        ),
    )
    outputs = Retroicor.output_spec()

    for key, metadata in list(output_map.items()):
        for metakey, value in list(metadata.items()):
            assert getattr(outputs.traits()[key], metakey) == value
