def test_add_dict(self): """ Tests the add_dict method """ dispatcher = Dispatcher() dispatcher.add_dict(METHOD_MAP) self.assertDictEqual(METHOD_MAP, dispatcher.method_handlers, "Method map was not updated properly")
def test_add_dict_prefix(self): """ Tests the add_dict method with a prefix """ method_map = {("prefix." + k): v for k, v in METHOD_MAP.items()} dispatcher = Dispatcher() dispatcher.add_dict(METHOD_MAP, prefix="prefix") self.assertDictEqual(method_map, dispatcher.method_handlers, "Method map was not updated properly")