Skip to content

Commit 0a6045a

Browse files
authored
docs: update test_lit_server.py (#222)
Indentity -> Identity
1 parent 7923bc4 commit 0a6045a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/test_lit_server.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ def test_server_terminate():
356356
mock_manager.shutdown.assert_called()
357357

358358

359-
class IndentityAPI(ls.examples.SimpleLitAPI):
359+
class IdentityAPI(ls.examples.SimpleLitAPI):
360360
def predict(self, x, context):
361361
context["input"] = x
362362
return self.model(x)
@@ -366,7 +366,7 @@ def encode_response(self, output, context):
366366
return {"output": input}
367367

368368

369-
class IndentityBatchedAPI(ls.examples.SimpleBatchedAPI):
369+
class IdentityBatchedAPI(ls.examples.SimpleBatchedAPI):
370370
def predict(self, x_batch, context):
371371
for c, x in zip(context, x_batch):
372372
c["input"] = x
@@ -377,7 +377,7 @@ def encode_response(self, output, context):
377377
return {"output": input}
378378

379379

380-
class IndentityBatchedStreamingAPI(ls.examples.SimpleBatchedAPI):
380+
class IdentityBatchedStreamingAPI(ls.examples.SimpleBatchedAPI):
381381
def predict(self, x_batch, context):
382382
for c, x in zip(context, x_batch):
383383
c["input"] = x
@@ -407,22 +407,22 @@ def dummy_load_and_raise(resp):
407407
mocked_load_and_raise.side_effect = dummy_load_and_raise
408408

409409
# Test context injection with single loop
410-
api = IndentityAPI()
410+
api = IdentityAPI()
411411
server = LitServer(api)
412412
with wrap_litserve_start(server) as server:
413413
async with LifespanManager(server.app) as manager, AsyncClient(app=manager.app, base_url="http://test") as ac:
414414
resp = await ac.post("/predict", json={"input": 5.0}, timeout=10)
415415
assert resp.json()["output"] == 5.0, "output from Identity server must be same as input"
416416

417417
# Test context injection with batched loop
418-
server = LitServer(IndentityBatchedAPI(), max_batch_size=2, batch_timeout=0.01)
418+
server = LitServer(IdentityBatchedAPI(), max_batch_size=2, batch_timeout=0.01)
419419
with wrap_litserve_start(server) as server:
420420
async with LifespanManager(server.app) as manager, AsyncClient(app=manager.app, base_url="http://test") as ac:
421421
resp = await ac.post("/predict", json={"input": 5.0}, timeout=10)
422422
assert resp.json()["output"] == 5.0, "output from Identity server must be same as input"
423423

424424
# Test context injection with batched streaming loop
425-
server = LitServer(IndentityBatchedStreamingAPI(), max_batch_size=2, batch_timeout=0.01, stream=True)
425+
server = LitServer(IdentityBatchedStreamingAPI(), max_batch_size=2, batch_timeout=0.01, stream=True)
426426
with wrap_litserve_start(server) as server:
427427
async with LifespanManager(server.app) as manager, AsyncClient(app=manager.app, base_url="http://test") as ac:
428428
resp = await ac.post("/predict", json={"input": 5.0}, timeout=10)

0 commit comments

Comments
 (0)