# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ..utils import Unifize


def test_Unifize_inputs():
    input_map = dict(
        args=dict(argstr="%s",),
        cl_frac=dict(argstr="-clfrac %f",),
        environ=dict(nohash=True, usedefault=True,),
        epi=dict(argstr="-EPI", requires=["no_duplo", "t2"], xor=["gm"],),
        gm=dict(argstr="-GM",),
        in_file=dict(
            argstr="-input %s",
            copyfile=False,
            extensions=None,
            mandatory=True,
            position=-1,
        ),
        no_duplo=dict(argstr="-noduplo",),
        num_threads=dict(nohash=True, usedefault=True,),
        out_file=dict(
            argstr="-prefix %s",
            extensions=None,
            name_source="in_file",
            name_template="%s_unifized",
        ),
        outputtype=dict(),
        quiet=dict(argstr="-quiet",),
        rbt=dict(argstr="-rbt %f %f %f",),
        scale_file=dict(argstr="-ssave %s", extensions=None,),
        t2=dict(argstr="-T2",),
        t2_up=dict(argstr="-T2up %f",),
        urad=dict(argstr="-Urad %s",),
    )
    inputs = Unifize.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_Unifize_outputs():
    output_map = dict(
        out_file=dict(extensions=None,), scale_file=dict(extensions=None,),
    )
    outputs = Unifize.output_spec()

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