def test_send_message(self): with mock.patch('mcollective.Client') as mocked: rpc = SimpleRPC( agent='foo', action='bar', config=TEST_CFG, ) rpc.send(ham='eggs') put = rpc.stomp_client.put put.assert_called()
def test_send_message(self): with mock.patch('mcollective.Client') as mocked: instance = mocked.return_value instance.get_nowait = mock.Mock(side_effect=stompy.Empty) rpc = SimpleRPC( agent='foo', action='bar', config=self.cfg, ) rpc.send(ham='eggs') put = rpc.stomp_client.put put.assert_called()