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


def test_FitGLM_inputs():
    input_map = dict(
        TR=dict(
            mandatory=True,
        ),
        drift_model=dict(
            usedefault=True,
        ),
        hrf_model=dict(
            usedefault=True,
        ),
        mask=dict(
            extensions=None,
        ),
        method=dict(
            usedefault=True,
        ),
        model=dict(
            usedefault=True,
        ),
        normalize_design_matrix=dict(
            usedefault=True,
        ),
        plot_design_matrix=dict(
            usedefault=True,
        ),
        save_residuals=dict(
            usedefault=True,
        ),
        session_info=dict(
            mandatory=True,
        ),
    )
    inputs = FitGLM.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_FitGLM_outputs():
    output_map = dict(
        a=dict(
            extensions=None,
        ),
        axis=dict(),
        beta=dict(
            extensions=None,
        ),
        constants=dict(),
        dof=dict(),
        nvbeta=dict(),
        reg_names=dict(),
        residuals=dict(
            extensions=None,
        ),
        s2=dict(
            extensions=None,
        ),
    )
    outputs = FitGLM.output_spec()

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