formatting

This commit is contained in:
Abubakar Abid 2022-02-27 16:47:12 -05:00
parent ea96e1f753
commit 95ff9740e5
2 changed files with 5 additions and 5 deletions

View File

@ -91,7 +91,7 @@ def start_server(
port: the port number the server is running on
path_to_local_server: the complete address that the local server can be accessed at
app: the FastAPI app object
server: the server object that is a subclass of uvicorn.Server (used to close the server)
server: the server object that is a subclass of uvicorn.Server (used to close the server)
"""
server_name = server_name or LOCALHOST_NAME
# if port is not specified, search for first available port

View File

@ -44,14 +44,14 @@ class TestInterfaceCustomParameters(unittest.TestCase):
self.assertEqual(response.status_code, 500)
self.assertTrue("error" in response.json())
io.close()
class TestStartServer(unittest.TestCase):
def test_start_server(self):
io = Interface(lambda x: x, "number", "number")
port = networking.get_first_available_port(
networking.INITIAL_PORT_VALUE,
networking.INITIAL_PORT_VALUE+networking.TRY_NUM_PORTS
networking.INITIAL_PORT_VALUE,
networking.INITIAL_PORT_VALUE + networking.TRY_NUM_PORTS,
)
_, local_path, _, server = networking.start_server(io, server_port=port)
url = urllib.parse.urlparse(local_path)