ska_pst.lmc.test

This subpackage with test TANGO device as client.

class ska_pst.lmc.test.TestMockServicer(*args: Any, **kwargs: Any)[source]

Test Servicer that acts on the requests sent to the test server.

This is meant to be used within testing frameworks to allow asserting that the API is called.

abort(request: ska_pst.grpc.lmc.ska_pst_lmc_pb2.AbortRequest, context: grpc.ServicerContext) ska_pst.grpc.lmc.ska_pst_lmc_pb2.AbortResponse[source]

Handle end scan.

configure_beam(request: ska_pst.grpc.lmc.ska_pst_lmc_pb2.ConfigureBeamRequest, context: grpc.ServicerContext) ska_pst.grpc.lmc.ska_pst_lmc_pb2.ConfigureBeamResponse[source]

Handle assign resources.

configure_scan(request: ska_pst.grpc.lmc.ska_pst_lmc_pb2.ConfigureScanRequest, context: grpc.ServicerContext) ska_pst.grpc.lmc.ska_pst_lmc_pb2.ConfigureScanResponse[source]

Handle configure request.

connect(request: ska_pst.grpc.lmc.ska_pst_lmc_pb2.ConnectionRequest, context: grpc.ServicerContext) ska_pst.grpc.lmc.ska_pst_lmc_pb2.ConnectionResponse[source]

Handle connection request from client.

deconfigure_beam(request: ska_pst.grpc.lmc.ska_pst_lmc_pb2.DeconfigureBeamRequest, context: grpc.ServicerContext) ska_pst.grpc.lmc.ska_pst_lmc_pb2.DeconfigureBeamResponse[source]

Handle release resources.

deconfigure_scan(request: ska_pst.grpc.lmc.ska_pst_lmc_pb2.DeconfigureScanRequest, context: grpc.ServicerContext) ska_pst.grpc.lmc.ska_pst_lmc_pb2.DeconfigureScanResponse[source]

Handle deconfigure request.

get_beam_configuration(request: ska_pst.grpc.lmc.ska_pst_lmc_pb2.GetBeamConfigurationRequest, context: grpc.ServicerContext) ska_pst.grpc.lmc.ska_pst_lmc_pb2.GetBeamConfigurationResponse[source]

Handle getting the assigned resources.

get_env(request: ska_pst.grpc.lmc.ska_pst_lmc_pb2.GetEnvironmentRequest, context: grpc.ServicerContext) ska_pst.grpc.lmc.ska_pst_lmc_pb2.GetEnvironmentResponse[source]

Get environment.

get_log_level(request: ska_pst.grpc.lmc.ska_pst_lmc_pb2.GetLogLevelRequest, context: grpc.ServicerContext) ska_pst.grpc.lmc.ska_pst_lmc_pb2.GetLogLevelResponse[source]

Get Log Level.

get_scan_configuration(request: ska_pst.grpc.lmc.ska_pst_lmc_pb2.GetScanConfigurationRequest, context: grpc.ServicerContext) ska_pst.grpc.lmc.ska_pst_lmc_pb2.GetScanConfigurationResponse[source]

Handle getting the scan configuration.

get_state(request: ska_pst.grpc.lmc.ska_pst_lmc_pb2.GetStateRequest, context: grpc.ServicerContext) ska_pst.grpc.lmc.ska_pst_lmc_pb2.GetStateResponse[source]

Handle getting the state of the service.

go_to_fault(request: ska_pst.grpc.lmc.ska_pst_lmc_pb2.GoToFaultRequest, context: grpc.ServicerContext) ska_pst.grpc.lmc.ska_pst_lmc_pb2.GoToFaultResponse[source]

Handle putting service into FAULT state.

monitor(request: ska_pst.grpc.lmc.ska_pst_lmc_pb2.MonitorRequest, context: grpc.ServicerContext) Generator[ska_pst.grpc.lmc.ska_pst_lmc_pb2.MonitorResponse, None, None][source]

Handle monitor.

reset(request: ska_pst.grpc.lmc.ska_pst_lmc_pb2.ResetRequest, context: grpc.ServicerContext) ska_pst.grpc.lmc.ska_pst_lmc_pb2.ResetResponse[source]

Handle reset.

set_log_level(request: ska_pst.grpc.lmc.ska_pst_lmc_pb2.SetLogLevelRequest, context: grpc.ServicerContext) ska_pst.grpc.lmc.ska_pst_lmc_pb2.SetLogLevelResponse[source]

Set Log Level.

start_scan(request: ska_pst.grpc.lmc.ska_pst_lmc_pb2.StartScanRequest, context: grpc.ServicerContext) ska_pst.grpc.lmc.ska_pst_lmc_pb2.StartScanResponse[source]

Handle scan.

stop_scan(request: ska_pst.grpc.lmc.ska_pst_lmc_pb2.StopScanRequest, context: grpc.ServicerContext) ska_pst.grpc.lmc.ska_pst_lmc_pb2.StopScanResponse[source]

Handle end scan.

class ska_pst.lmc.test.TestPstLmcService(grpc_server: grpc.Server, logger: Optional[Logger] = None, **kwargs: Any)[source]

The service class for testing the gRPC LMC service.

This class is designed to be used in unit testing but having instances of the TestMockServicer passed in as a parameter or can be used in an integration test where this could be run dependently with specific instances of a PstLmcServiceServicer. For now there is only the TestMockServicer that has been implemented.

serve(started_callback: Optional[Callable] = None) None[source]

Start the gRPC server to serve requests.

This method should be called synchronously as this method will set up the gRPC in a background thread itself. If the client wants to be notified when the background thread is serving then a started_callback should be passed.

Parameters

started_callback (Optional[Callable], optional) – a callback that will be called when the background thread is running, defaults to None.

stop() None[source]

Stop the background serving of requests.