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


def test_AI_inputs():
    input_map = dict(
        args=dict(argstr="%s",),
        convergence=dict(argstr="-c [%d,%g,%d]", usedefault=True,),
        dimension=dict(argstr="-d %d", usedefault=True,),
        environ=dict(nohash=True, usedefault=True,),
        fixed_image=dict(extensions=None, mandatory=True,),
        fixed_image_mask=dict(argstr="-x %s", extensions=None,),
        metric=dict(argstr="-m %s", mandatory=True,),
        moving_image=dict(extensions=None, mandatory=True,),
        moving_image_mask=dict(extensions=None, requires=["fixed_image_mask"],),
        num_threads=dict(nohash=True, usedefault=True,),
        output_transform=dict(argstr="-o %s", extensions=None, usedefault=True,),
        principal_axes=dict(argstr="-p %d", usedefault=True, xor=["blobs"],),
        search_factor=dict(argstr="-s [%g,%g]", usedefault=True,),
        search_grid=dict(argstr="-g %s",),
        transform=dict(argstr="-t %s[%g]", usedefault=True,),
        verbose=dict(argstr="-v %d", usedefault=True,),
    )
    inputs = AI.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_AI_outputs():
    output_map = dict(output_transform=dict(extensions=None,),)
    outputs = AI.output_spec()

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