コード例 #1
0
ファイル: thrift_pool_tests.py プロジェクト: dwick/baseplate
    def test_unix(self):
        endpoint = config.EndpointConfiguration(
            socket.AF_UNIX, "/tmp/socket")
        protocol = thrift_pool._make_protocol(endpoint)

        socket_transport = protocol.trans.getTransport()
        self.assertTrue(socket_transport._unix_socket)
コード例 #2
0
ファイル: thrift_pool_tests.py プロジェクト: dwick/baseplate
    def test_inet(self):
        endpoint = config.EndpointConfiguration(
            socket.AF_INET, ("localhost", 1234))
        protocol = thrift_pool._make_protocol(endpoint)

        socket_transport = protocol.trans.getTransport()
        self.assertFalse(socket_transport._unix_socket)
コード例 #3
0
ファイル: thrift_pool_tests.py プロジェクト: us1415/baseplate
    def test_inet(self):
        endpoint = config.EndpointConfiguration(socket.AF_INET,
                                                ("localhost", 1234))
        protocol = thrift_pool._make_protocol(endpoint)

        socket_transport = protocol.trans.getTransport()
        self.assertFalse(socket_transport._unix_socket)
コード例 #4
0
ファイル: thrift_pool_tests.py プロジェクト: dwick/baseplate
    def test_unknown(self):
        endpoint = config.EndpointConfiguration(
            socket.AF_UNSPEC, None)

        with self.assertRaises(Exception):
            thrift_pool._make_protocol(endpoint)
コード例 #5
0
ファイル: thrift_pool_tests.py プロジェクト: us1415/baseplate
    def test_unknown(self):
        endpoint = config.EndpointConfiguration(socket.AF_UNSPEC, None)

        with self.assertRaises(Exception):
            thrift_pool._make_protocol(endpoint)
コード例 #6
0
ファイル: thrift_pool_tests.py プロジェクト: us1415/baseplate
    def test_unix(self):
        endpoint = config.EndpointConfiguration(socket.AF_UNIX, "/tmp/socket")
        protocol = thrift_pool._make_protocol(endpoint)

        socket_transport = protocol.trans.getTransport()
        self.assertTrue(socket_transport._unix_socket)
コード例 #7
0
def check_thrift_service(endpoint):
    protocol = _make_protocol(endpoint)
    protocol.trans.getTransport().setTimeout(TIMEOUT * 1000.)
    protocol.trans.open()
    client = BaseplateService.Client(protocol)
    assert client.is_healthy(), "service indicated unhealthiness"