testframework.clients.ops.tester.tester_client_recorded module

A class representing the tester part for the recorded Ops Client.

This class extends the OpsClient class and adds an annotation write to action methods.

class testframework.clients.ops.tester.tester_client_recorded.OpsClientRecorded(tb: TestBench, default_timeout: int)

Bases: OpsClient

A class representing the tester for the Ops Client.

This class extends the OpsClient class and adds a annotation write to action methods so it’s called recorded version of ops client

This client will only work correctly if the testbench contains a testbrain. :raises AssertionError: If there is no Testbrain on the bench.

Parameters:
  • default_timeout (int) – time in seconds before timing out api calls

  • tb – (TestBench): TestBench Inventory Model

ensure_influx_connection()

Checks if the influx connection works

Will raise an exception if connection couldn’t be established

post_pv_action(pv_action: PvActionRequest) float | ErrorResponse

Sends a POST request to the Pv Action endpoint.

Parameters:

pv_action (PvActionRequest) – The PvActionRequest object containing the data for the request.

Raises:

ValueError – If the response code is not 200 or 400.

Returns:

The start time of the request if successful, or an ErrorResponse object if there was an error.

Return type:

float | ErrorResponse

put_grid_control_lpc(data: LoadLimitRequest) GridControlResponse

Puts Limit Power Consumption to operation container.

Parameters:

data (LoadLimitRequest) – The data containing the load limit request.

Raises:

ValidationError – if failed to parse response from API.

Returns:

The response from the operation container.

Return type:

GridControlResponse

put_grid_control_lpp(data: LoadLimitRequest) GridControlResponse

Puts Limit Power Production to operation container.

Parameters:

data (LoadLimitRequest) – The data containing the load limit request.

Raises:

ValidationError – If failed to parse response from API

Returns:

The response from the operation container.

Return type:

GridControlResponse