# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ..aroma import ICA_AROMA


def test_ICA_AROMA_inputs():
    input_map = dict(
        TR=dict(argstr="-tr %.3f",),
        args=dict(argstr="%s",),
        denoise_type=dict(argstr="-den %s", mandatory=True, usedefault=True,),
        dim=dict(argstr="-dim %d",),
        environ=dict(nohash=True, usedefault=True,),
        feat_dir=dict(
            argstr="-feat %s",
            mandatory=True,
            xor=["in_file", "mat_file", "fnirt_warp_file", "motion_parameters"],
        ),
        fnirt_warp_file=dict(argstr="-warp %s", extensions=None, xor=["feat_dir"],),
        in_file=dict(
            argstr="-i %s", extensions=None, mandatory=True, xor=["feat_dir"],
        ),
        mask=dict(argstr="-m %s", extensions=None, xor=["feat_dir"],),
        mat_file=dict(argstr="-affmat %s", extensions=None, xor=["feat_dir"],),
        melodic_dir=dict(argstr="-meldir %s",),
        motion_parameters=dict(
            argstr="-mc %s", extensions=None, mandatory=True, xor=["feat_dir"],
        ),
        out_dir=dict(argstr="-o %s", mandatory=True, usedefault=True,),
    )
    inputs = ICA_AROMA.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_ICA_AROMA_outputs():
    output_map = dict(
        aggr_denoised_file=dict(extensions=None,),
        nonaggr_denoised_file=dict(extensions=None,),
        out_dir=dict(),
    )
    outputs = ICA_AROMA.output_spec()

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