IqmServerMockBase#

class IqmServerMockBase#

Bases: QuantumComputersServicer, CalibrationsServicer, JobsServicer

Base class for IQM server mocks. Only meant for testing IQM library packages, do not use outside of tests!

Module: iqm.station_control.client.iqm_server.testing.iqm_server_mock

Methods

channel

Gets a grpc.Channel that connects to this mock server instance.

chunk_stream

A utility function for converting a binary data blob into a`(stream DataChunk)`.

parse_uuid

Helper function for generating protobuf UUIDs

proto_timestamp

Helper function for generating protobuf timestamps

proto_uuid

Helper function for generating protobuf UUIDs

static proto_uuid(base=None)#

Helper function for generating protobuf UUIDs

Parameters:

base (UUID | None) –

Return type:

Uuid

static parse_uuid(value)#

Helper function for generating protobuf UUIDs

Parameters:

value (Uuid) –

Return type:

UUID

static proto_timestamp(base=None)#

Helper function for generating protobuf timestamps

Parameters:

base (datetime | None) –

Return type:

Timestamp

channel()#

Gets a grpc.Channel that connects to this mock server instance. Can be used to initialize a new IqmServerClient that uses this mock server instance as a backend for the invoked GRPC calls.

Return type:

Channel

static chunk_stream(data)#

A utility function for converting a binary data blob into a`(stream DataChunk)`.

Parameters:

data (bytes) –

Return type:

Iterator[DataChunk]