def configure(self): self.ctx.super.return_value = self.superclass = MagicMock() self.publisher = BlockingJSONPublisher(sentinel.broker) self.publisher._serialize = MagicMock(return_value=sentinel.body) self.publisher._channel = MagicMock(is_open=True) self.properties = MagicMock(content_type=None)
def execute(self): BlockingJSONPublisher(self.broker).publish(self.exchange, self.routing_key, self.payload)
def should_extend_BlockingPublisher(self): isinstance(BlockingJSONPublisher(sentinel.broker), BlockingPublisher)