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'"
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"]
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())