mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
13 lines
280 B
Python
13 lines
280 B
Python
import socket
|
|
|
|
from galaxy.util import sockets
|
|
|
|
|
|
def test_unused_free_port_unconstrained():
|
|
port = sockets.unused_port()
|
|
|
|
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
# would throw exception if port was not free.
|
|
s.bind(("localhost", port))
|
|
s.close()
|