def test_alive(self): httpretty.enable() httpretty.register_uri(httpretty.GET, SERVICE_URL, body="LIVE") monitor = SocketPortMonitor(SERVICE_HOST, port=SERVICE_PORT); self.assertTrue(monitor.alive()) httpretty.disable() httpretty.reset()
def test_alive(self): httpretty.enable() httpretty.register_uri(httpretty.GET, SERVICE_URL, body="LIVE") monitor = SocketPortMonitor(SERVICE_HOST, port=SERVICE_PORT) self.assertTrue(monitor.alive()) httpretty.disable() httpretty.reset()
def test_out(self): monitor = SocketPortMonitor('hostnotexists', port=SERVICE_PORT); self.assertFalse(monitor.alive())
def test_out(self): monitor = SocketPortMonitor('hostnotexists', port=SERVICE_PORT) self.assertFalse(monitor.alive())