예제 #1
0
 def test_check_names_mismatch(self):
     d = dict(thinga=Mock(yamlname="thinga"),
              thingb=Mock(yamlname="thingc"))
     with self.assertRaises(AssertionError) as cm:
         check_yaml_names(d)
     assert str(cm.exception) == \
         "'thingb' should be called 'thingc' as it comes from 'thingc.yaml'"
예제 #2
0
 def test_check_names_good(self):
     d = dict(
         thinga=Mock(yamlname="thinga"),
         thingb=Mock(yamlname="thingb"),
         hidden=Mock(spec=dict),
     )
     a = check_yaml_names(d)
     assert a == ["thinga", "thingb"]
예제 #3
0
from malcolm.yamlutil import make_block_creator, check_yaml_names

hdf_writer_block = make_block_creator(__file__, "hdf_writer_block.yaml")
position_labeller_block = make_block_creator(__file__,
                                             "position_labeller_block.yaml")
stats_plugin_block = make_block_creator(__file__, "stats_plugin_block.yaml")

__all__ = check_yaml_names(globals())