예제 #1
0
 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)
예제 #2
0
파일: tool_test.py 프로젝트: minqf/vdsm
 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)
     ])
예제 #3
0
파일: tool_test.py 프로젝트: vjuranek/vdsm
    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)])
예제 #4
0
파일: statsd_test.py 프로젝트: EdDev/vdsm
 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)