Skip to content

Commit

Permalink
add example for using server (#345)
Browse files Browse the repository at this point in the history
  • Loading branch information
wzh1994 authored Nov 14, 2024
1 parent 89eaf71 commit 7ec1ca2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/basic_tests/test_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,12 @@ def test_engine_server(self):
assert engine.status(gid) == {'1': 'running', '2': lazyllm.launcher.Status.Running, '3': 'running'}
assert engine.run(gid, 1) == 2
time.sleep(3)

server = engine.build_node('graph-1').func._g
assert isinstance(server, lazyllm.ServerModule)
m = lazyllm.UrlModule(url=server._url)
assert m(2) == 4

web = engine.build_node('graph-1').func._web
assert engine.build_node('graph-1').func.api_url is not None
assert engine.build_node('graph-1').func.web_url == web.url
Expand Down

0 comments on commit 7ec1ca2

Please sign in to comment.