testframework.clients.brain.base_client module

This module is a base client to interact with testbrain

it provides functionality to operate Contactors of a testbench via API or to operate a DC Source bench

Every Contactor Point can be switched on or off

class testframework.clients.brain.base_client.BaseClient(url: str, default_timeout: int)

Bases: object

A class to access Contactor & Testframework API

This is the “naked class” which is used for managing http requests. For tests, we recommend using the TestClient which extends the BaseClient

The base client for interacting with the Testframework Contactor API

This class provides methods for making HTTP requests to the Testframework Contactor API, such as GET and PUT requests. It also includes methods for retrieving all available contactors as well as getting and setting a contactor state.

Constructor:

url (str): The base URL of the TestFramework API. default_timeout (int): The default timeout value for HTTP requests. url_id: optional (int): ID for initialized dc source

get_available_contactors() GetAllContactorsResponse

gets available contactors of testframework API

get_contactor_state(contactor_point: ContactorPoints) ContactorStateResponse

Retrieves the state of a contactor.

Parameters:

contactor_point (ContactorPoints) – The contactor point to retrieve the state for.

Returns:

The response containing the state of the contactor.

Return type:

ContactorStateResponse

Raises:
  • ValueError – If the requested contactor is not available on the testbrain.

  • ValidationError – If the response fails to validate the contactor state.

get_testbench_type() TestBenchType
put_dcsource_state(dcstate: DcState)
Parameters:

dcstate (DcState) – DC State power output enabled on/off

Returns:

DC State power output enabled on/off

Return type:

DcState

set_contactor_state(contactor_point: ContactorPoints, contactor_state: ContactorState) ContactorStateResponse

sets contactor state for contactor point via testframework API