MCPcopy Create free account
hub / github.com/apache/arrow / test_flight_domain_socket

Function test_flight_domain_socket

python/pyarrow/tests/test_flight.py:1358–1376  ·  view source on GitHub ↗

Try a simple do_get call over a Unix domain socket.

()

Source from the content-addressed store, hash-verified

1356@pytest.mark.skipif(os.name == 'nt',
1357 reason="Unix sockets can't be tested on Windows")
1358def test_flight_domain_socket():
1359 """Try a simple do_get call over a Unix domain socket."""
1360 with tempfile.NamedTemporaryFile() as sock:
1361 sock.close()
1362 location = flight.Location.for_grpc_unix(sock.name)
1363 with ConstantFlightServer(location=location), \
1364 FlightClient(location) as client:
1365
1366 reader = client.do_get(flight.Ticket(b'ints'))
1367 table = simple_ints_table()
1368 assert reader.schema.equals(table.schema)
1369 data = reader.read_all()
1370 assert data.equals(table)
1371
1372 reader = client.do_get(flight.Ticket(b'dicts'))
1373 table = simple_dicts_table()
1374 assert reader.schema.equals(table.schema)
1375 data = reader.read_all()
1376 assert data.equals(table)
1377
1378
1379@pytest.mark.slow

Callers

nothing calls this directly

Calls 7

FlightClientClass · 0.90
simple_ints_tableFunction · 0.85
simple_dicts_tableFunction · 0.85
equalsMethod · 0.80
closeMethod · 0.45
do_getMethod · 0.45

Tested by

no test coverage detected