Exemplo n.º 1
0
    def test_missing_severity(self):
        """Assert the default severity is INFO if it's not in the headers."""
        msg = message.Message(severity=message.ERROR)
        del msg._headers["fedora_messaging_severity"]

        recv_msg = message.get_message("", msg._properties, b"{}")
        self.assertEqual(recv_msg.severity, message.INFO)
Exemplo n.º 2
0
    def test_missing_headers(self):
        """Assert missing headers results in a default message."""
        msg = message.Message()
        msg._headers = None

        received_msg = message.get_message(msg._encoded_routing_key,
                                           msg._properties, msg._encoded_body)
        self.assertIsInstance(received_msg, message.Message)