def test_listen(self): t = transport.Transport(_FakeDriver(cfg.CONF)) t._driver.listen = mock.Mock() t._listen(self._target, 1, None) t._driver.listen.assert_called_once_with(self._target, 1, None)
def test_listen(self): t = transport.Transport(_FakeDriver(cfg.CONF)) self.mox.StubOutWithMock(t._driver, 'listen') t._driver.listen(self._target, 1, None) self.mox.ReplayAll() t._listen(self._target, 1, None)
def test_send_notification(self): t = transport.Transport(_FakeDriver(cfg.CONF)) self.mox.StubOutWithMock(t._driver, 'send_notification') t._driver.send_notification(self._target, 'ctxt', 'message', 1.0, retry=None) self.mox.ReplayAll() t._send_notification(self._target, 'ctxt', 'message', version=1.0)
def test_send_defaults(self): t = transport.Transport(_FakeDriver(cfg.CONF)) self.mox.StubOutWithMock(t._driver, 'send') t._driver.send(self._target, 'ctxt', 'message', wait_for_reply=None, timeout=None, retry=None) self.mox.ReplayAll() t._send(self._target, 'ctxt', 'message')
def test_send_notification(self): t = transport.Transport(_FakeDriver(cfg.CONF)) t._driver.send_notification = mock.Mock() t._send_notification(self._target, 'ctxt', 'message', version=1.0) t._driver.send_notification.assert_called_once_with(self._target, 'ctxt', 'message', 1.0, retry=None)
def test_send_all_args(self): t = transport.Transport(_FakeDriver(cfg.CONF)) self.mox.StubOutWithMock(t._driver, 'send') t._driver.send(self._target, 'ctxt', 'message', wait_for_reply='wait_for_reply', timeout='timeout', retry='retry') self.mox.ReplayAll() t._send(self._target, 'ctxt', 'message', wait_for_reply='wait_for_reply', timeout='timeout', retry='retry')
def test_send_defaults(self): t = transport.Transport(_FakeDriver(cfg.CONF)) t._driver.send = mock.Mock() t._send(self._target, 'ctxt', 'message') t._driver.send.assert_called_once_with(self._target, 'ctxt', 'message', wait_for_reply=None, timeout=None, retry=None)
def test_send_all_args(self): t = transport.Transport(_FakeDriver(cfg.CONF)) t._driver.send = mock.Mock() t._send(self._target, 'ctxt', 'message', wait_for_reply='wait_for_reply', timeout='timeout', call_monitor_timeout='cm_timeout', retry='retry') t._driver.send.\ assert_called_once_with(self._target, 'ctxt', 'message', wait_for_reply='wait_for_reply', timeout='timeout', call_monitor_timeout='cm_timeout', retry='retry')