

def test_unknown_error_on_send_message_raises(self):

    class MyException(Exception):
        pass

    def _send_message(rabbit_self, msg, routing_key):
        raise MyException('meow')
    notifier_.notify_kombu.RabbitStrategy._send_message = _send_message
    notifier_ = notifier.Notifier(self.conf)
    self.assertRaises(MyException, notifier_.error, 'a', 'b')

dataset/ETHPy150Open rcbops/glance-buildpackage/glance/tests/unit/test_notifier.py TestRabbitNotifier.test_unknown_error_on_send_message_raises/VarMisuse@42/61 `self`->`notifier_`