示例#1
0
    def validate_callback(self) -> None:
        from hedwig.callback import Callback

        try:
            self._callback = Callback.find_by_message(
                self.type, self.data_schema_version.version[0])
        except CallbackNotFound:
            raise ValidationError
示例#2
0
 def test_find_by_name_fail(self):
     with pytest.raises(CallbackNotFound):
         Callback.find_by_message(MessageType.vehicle_created, 1)
示例#3
0
 def test_find_by_message(self):
     assert Callback.find_by_message(MessageType.trip_created,
                                     1)._fn == trip_created_handler