def test_check_alive(self):
        httpretty.enable()
        httpretty.register_uri(httpretty.GET, SERVICE_URL, body="LIVE")

        self.assertTrue(check_alive('SocketPortMonitor', SERVICE_HOST, port='8888'))

        httpretty.disable()
        httpretty.reset()
    def test_check_alive(self):
        httpretty.enable()
        httpretty.register_uri(httpretty.GET, SERVICE_URL, body="LIVE")

        self.assertTrue(
            check_alive('SocketPortMonitor', SERVICE_HOST, port='8888'))

        httpretty.disable()
        httpretty.reset()
 def test_check_alive(self):
     self.assertTrue(check_alive('TextMonitor', SERVICE_URL, expected='LIVE'))
 def test_check_alive(self):
     httpretty.register_uri(httpretty.GET, SERVICE_URL, status=200)
     self.assertTrue(
         check_alive('HTTPStatusMonitor', SERVICE_URL, code='200'))
コード例 #5
0
    def get(self, label):
        monitor = Monitor()
        monitor.load(label)

        alive = check_alive(monitor.monitor_type, monitor.url, **monitor.data)
        self.success({"monitor": monitor.get_attributes(), "alive": alive})
コード例 #6
0
 def test_check_alive(self):
     self.assertTrue(
         check_alive('TextMonitor', SERVICE_URL, expected='LIVE'))
 def test_check_alive(self):
     httpretty.register_uri(httpretty.GET, SERVICE_URL, status=200)
     self.assertTrue(check_alive('HTTPStatusMonitor', SERVICE_URL, code='200'))