MCPcopy Create free account
hub / github.com/EmbeddedRPC/erpc / run_server

Function run_server

test/python_impl_tests/conftest.py:146–168  ·  view source on GitHub ↗

Auxiliary function, that create SimpleServer using TransportFactory, add CommonService and services specified by current test and run it. Created server is assigned to global_server variable. :param transport_factory: TransportFactory to use :param services: list of services de

(transport_factory: TransportFactory, services: list[Service])

Source from the content-addressed store, hash-verified

144
145
146def run_server(transport_factory: TransportFactory, services: list[Service]) -> SimpleServer:
147 """
148 Auxiliary function, that create SimpleServer using TransportFactory, add CommonService and services specified by
149 current test and run it.
150
151 Created server is assigned to global_server variable.
152 :param transport_factory: TransportFactory to use
153 :param services: list of services defined by current test
154 :return: new server
155 """
156 global global_server
157
158 global_server = SimpleServer(transport_factory.build_transport(True), BasicCodec)
159
160 global_server.add_service(CommonService(CommonTestServiceHandler()))
161
162 for service in services:
163 global_server.add_service(service)
164
165 global_server.run()
166 print("Server: started")
167
168 return global_server
169
170
171@pytest.fixture(scope="module", autouse=True)

Callers 1

serverFunction · 0.85

Calls 6

runMethod · 0.95
SimpleServerClass · 0.90
CommonServiceClass · 0.90
build_transportMethod · 0.80
add_serviceMethod · 0.80

Tested by

no test coverage detected