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 theBaseClient
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:
- 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 ο
- set_contactor_state(contactor_point: ContactorPoints, contactor_state: ContactorState) ContactorStateResponse ο
sets contactor state for contactor point via testframework API