MCPcopy Index your code
hub / github.com/mudler/LocalAI / test_server_startup

Method test_server_startup

backend/python/diffusers/test.py:41–56  ·  view source on GitHub ↗

This method tests if the server starts up successfully

(self)

Source from the content-addressed store, hash-verified

39 self.service.wait()
40
41 def test_server_startup(self):
42 """
43 This method tests if the server starts up successfully
44 """
45 time.sleep(20)
46 try:
47 self.setUp()
48 with grpc.insecure_channel("localhost:50051") as channel:
49 stub = backend_pb2_grpc.BackendStub(channel)
50 response = stub.Health(backend_pb2.HealthMessage())
51 self.assertEqual(response.message, b'OK')
52 except Exception as err:
53 print(err)
54 self.fail("Server failed to start")
55 finally:
56 self.tearDown()
57
58 def test_load_model(self):
59 """

Callers

nothing calls this directly

Calls 3

setUpMethod · 0.95
tearDownMethod · 0.95
HealthMethod · 0.45

Tested by

no test coverage detected