from messagebus import MessageBus
from testdoubleutil import return_or_raise


class MessageBusStub(MessageBus):
    def __init__(self, send_message_ret=None, publish_event_ret=None):
        self.send_message_ret = send_message_ret
        self.publish_event_ret = publish_event_ret

    def publish_event(self, event):
        return return_or_raise(self.publish_event_ret)

    def send_message(self, component, message):
        return return_or_raise(self.send_message_ret)

    def subscribe(self, subject):
        pass

    def reply_message(self, message, reply_message):
        pass

    def reply_event(self, event, reply_message):
        pass
