Пример #1
0
 def test_check_success(self):
     response = yield checker.check_tcp("foo",
                                        self.port,
                                        None,
                                        io_loop=self.io_loop,
                                        query_params="",
                                        headers={})
     self.assertEqual(200, response[0])
Пример #2
0
 def test_check_failure(self):
     with mock.patch.object(checker, 'TIMEOUT', 1):
         response = yield checker.check_tcp("foo",
                                            self.unlistened_port,
                                            None,
                                            io_loop=self.io_loop,
                                            query_params="",
                                            headers={})
         self.assertEqual(response[0], 503)
Пример #3
0
 def test_check_failure(self):
     with mock.patch.object(checker.config, 'config',
                            {'healthcheck_timeout': 1}):
         response = yield checker.check_tcp("foo",
                                            self.unlistened_port,
                                            None,
                                            '127.0.0.1',
                                            io_loop=self.io_loop,
                                            query_params="",
                                            headers={})
         self.assertEqual(response[0], 503)
Пример #4
0
 def test_check_failure(self):
     with mock.patch.object(checker, 'TIMEOUT', 1):
         response = yield checker.check_tcp("foo", self.unlistened_port, None, io_loop=self.io_loop, query_params="", headers={})
         self.assertEqual(response[0], 503)
Пример #5
0
 def test_check_success(self):
     response = yield checker.check_tcp("foo", self.port, None, io_loop=self.io_loop, query_params="", headers={})
     self.assertEqual(200, response[0])