mirror of
https://github.com/gradio-app/gradio.git
synced 2025-02-23 11:39:17 +08:00
formatting
This commit is contained in:
parent
ea96e1f753
commit
95ff9740e5
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user