# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
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',
    descr='File to write center of mass to',
    hash_files=False,
    keep_extension=False,
    name_source='in_file',
    name_template='%s_cm.out',
    position=-1,
    ),
    environ=dict(nohash=True,
    usedefault=True,
    ),
    ignore_exception=dict(nohash=True,
    usedefault=True,
    ),
    in_file=dict(argstr='%s',
    copyfile=True,
    mandatory=True,
    position=-2,
    ),
    local_ijk=dict(argstr='-local_ijk',
    ),
    mask_file=dict(argstr='-mask %s',
    ),
    roi_vals=dict(argstr='-roi_vals %s',
    ),
    set_cm=dict(argstr='-set %f %f %f',
    ),
    terminal_output=dict(deprecated='1.0.0',
    nohash=True,
    ),
    )
    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(),
    out_file=dict(),
    )
    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
