def test_send_multiple(self): data = {'hello': 7, 'goodbye': 11} statsd.send(data) calls = [ mock.call(b'hello:7|g', self._address), mock.call(b'goodbye:11|g', self._address) ] self.mock_socket.return_value.sendto.assert_has_calls(calls)
def testLibvirtConfigureShouldEnableSockets(self): _setConfig(self, ('LCONF', 'lconf_ssl'), ('QCONF', 'qemu_ssl'), ) libvirt.configure() systemctl.enable.assert_has_calls([ mock.call(libvirt._LIBVIRT_TCP_SOCKET_UNIT), mock.call(libvirt._LIBVIRT_TLS_SOCKET_UNIT) ])
def testLibvirtConfigureShouldEnableTlsSocket(self): self.vdsm_cfg.set('vars', 'ssl', 'true') _setConfig( self, ('LCONF', 'lconf_ssl'), ('QCONF', 'qemu_ssl'), ) libvirt.configure() systemctl.enable.assert_has_calls( [mock.call(libvirt._LIBVIRT_TLS_SOCKET_UNIT)])
def test_send_multiple(self): data = {'hello': 7, 'goodbye': 11} statsd.send(data) calls = [mock.call(b'hello:7|g', self._address), mock.call(b'goodbye:11|g', self._address)] self.mock_socket.return_value.sendto.assert_has_calls(calls)