# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ..model import EstimateModel


def test_EstimateModel_inputs():
    input_map = dict(
        estimation_method=dict(
            field="method",
            mandatory=True,
        ),
        flags=dict(),
        matlab_cmd=dict(),
        mfile=dict(
            usedefault=True,
        ),
        paths=dict(),
        spm_mat_file=dict(
            copyfile=True,
            extensions=None,
            field="spmmat",
            mandatory=True,
        ),
        use_mcr=dict(),
        use_v8struct=dict(
            min_ver="8",
            usedefault=True,
        ),
        write_residuals=dict(
            field="write_residuals",
        ),
    )
    inputs = EstimateModel.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_EstimateModel_outputs():
    output_map = dict(
        ARcoef=dict(),
        Cbetas=dict(),
        RPVimage=dict(
            extensions=[".hdr", ".img", ".img.gz", ".nii"],
        ),
        SDbetas=dict(),
        SDerror=dict(),
        beta_images=dict(),
        labels=dict(
            extensions=[".hdr", ".img", ".img.gz", ".nii"],
        ),
        mask_image=dict(
            extensions=[".hdr", ".img", ".img.gz", ".nii"],
        ),
        residual_image=dict(
            extensions=[".hdr", ".img", ".img.gz", ".nii"],
        ),
        residual_images=dict(),
        spm_mat_file=dict(
            extensions=None,
        ),
    )
    outputs = EstimateModel.output_spec()

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