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


def test_CenterMass_inputs():
    input_map = dict(
        all_rois=dict(
            argstr="-all_rois",
        ),
        args=dict(
            argstr="%s",
        ),
        automask=dict(
            argstr="-automask",
        ),
        cm_file=dict(
            argstr="> %s",
            extensions=None,
            hash_files=False,
            keep_extension=False,
            name_source="in_file",
            name_template="%s_cm.out",
            position=-1,
        ),
        environ=dict(
            nohash=True,
            usedefault=True,
        ),
        in_file=dict(
            argstr="%s",
            copyfile=True,
            extensions=None,
            mandatory=True,
            position=-2,
        ),
        local_ijk=dict(
            argstr="-local_ijk",
        ),
        mask_file=dict(
            argstr="-mask %s",
            extensions=None,
        ),
        roi_vals=dict(
            argstr="-roi_vals %s",
        ),
        set_cm=dict(
            argstr="-set %f %f %f",
        ),
    )
    inputs = CenterMass.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_CenterMass_outputs():
    output_map = dict(
        cm=dict(),
        cm_file=dict(
            extensions=None,
        ),
        out_file=dict(
            extensions=None,
        ),
    )
    outputs = CenterMass.output_spec()

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