def test_choose_port_returns_an_open_port():
 app = OnionShare()
 app.choose_port()
 socket.socket().bind(('127.0.0.1', app.port))

def test_choose_port_returns_an_open_port ( ) : app = OnionShare ( ) app . choose_port ( ) socket . socket ( ) . bind ( ( '127.0.0.1' , app . port ) )
choose_port() returns an open port .