|
| 1 | +# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT |
| 2 | +from ....testing import assert_equal |
| 3 | +from ..preprocess import Hist |
| 4 | + |
| 5 | + |
| 6 | +def test_Hist_inputs(): |
| 7 | + input_map = dict(args=dict(argstr='%s', |
| 8 | + ), |
| 9 | + bin_width=dict(argstr='-binwidth %f', |
| 10 | + ), |
| 11 | + environ=dict(nohash=True, |
| 12 | + usedefault=True, |
| 13 | + ), |
| 14 | + ignore_exception=dict(nohash=True, |
| 15 | + usedefault=True, |
| 16 | + ), |
| 17 | + in_file=dict(argstr='-input %s', |
| 18 | + copyfile=False, |
| 19 | + mandatory=True, |
| 20 | + position=1, |
| 21 | + ), |
| 22 | + mask=dict(argstr='-mask %s', |
| 23 | + ), |
| 24 | + max_value=dict(argstr='-max %f', |
| 25 | + ), |
| 26 | + min_value=dict(argstr='-min %f', |
| 27 | + ), |
| 28 | + nbin=dict(argstr='-nbin %d', |
| 29 | + ), |
| 30 | + out_file=dict(argstr='-prefix %s', |
| 31 | + keep_extension=False, |
| 32 | + name_source=['in_file'], |
| 33 | + name_template='%s_hist', |
| 34 | + ), |
| 35 | + out_show=dict(argstr='> %s', |
| 36 | + keep_extension=False, |
| 37 | + name_source='in_file', |
| 38 | + name_template='%s_hist.out', |
| 39 | + position=-1, |
| 40 | + ), |
| 41 | + showhist=dict(argstr='-showhist', |
| 42 | + usedefault=True, |
| 43 | + ), |
| 44 | + terminal_output=dict(nohash=True, |
| 45 | + ), |
| 46 | + ) |
| 47 | + inputs = Hist.input_spec() |
| 48 | + |
| 49 | + for key, metadata in list(input_map.items()): |
| 50 | + for metakey, value in list(metadata.items()): |
| 51 | + yield assert_equal, getattr(inputs.traits()[key], metakey), value |
| 52 | + |
| 53 | + |
| 54 | +def test_Hist_outputs(): |
| 55 | + output_map = dict(out_file=dict(), |
| 56 | + out_show=dict(), |
| 57 | + ) |
| 58 | + outputs = Hist.output_spec() |
| 59 | + |
| 60 | + for key, metadata in list(output_map.items()): |
| 61 | + for metakey, value in list(metadata.items()): |
| 62 | + yield assert_equal, getattr(outputs.traits()[key], metakey), value |
0 commit comments