Ejemplo n.º 1
0
def client(message):
    with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
        ip = 'localhost'
        port = get_free_port()
        sock.connect((ip, port))
        sock.sendall(bytes(message, 'ascii'))
        response = str(sock.recv(1024), 'ascii')
        yield response
        sock.shutdown(socket.SHUT_RDWR)
        sock.close()
Ejemplo n.º 2
0
def server():
    HOST = "localhost"
    mock_server_port = get_free_port()
    start_tcp_main_server(HOST, mock_server_port)
    req = TupleSpaceClient(HOST, mock_server_port)
    return req
def setup_mock_kafka_connect_api(mock_name):
    kafka_connect_port = mocks.get_free_port()
    mocks.start_mock_server(kafka_connect_port, mock_name)
    return kafka_connect_port
Ejemplo n.º 4
0
 def setup_class(cls):
     cls.mock_server_port = get_free_port()
     start_mock_server(cls.mock_server_port)
Ejemplo n.º 5
0
def server1():
    mock_server_port = get_free_port()
    start_tcp_mock_server(HOST, mock_server_port)
    req = TupleSpaceClient(HOST, mock_server_port)
    return req
Ejemplo n.º 6
0
 def setUp(self):
     self.mock_server_port = get_free_port()
     start_mock_server(self.mock_server_port)
def setup_mock_server(mock_name):
    mock_port = mocks.get_free_port()
    mocks.start_mock_server(mock_port, mock_name)
    return mock_port