Mock
LLMTestServer
¶
Mock server for OpenAI API. This class is used to simulate the OpenAI API for testing purposes.
Source code in python/opsml/mock/_mock.pyi
__enter__()
¶
MockConfig
¶
Source code in python/opsml/mock/_mock.pyi
__init__(**kwargs)
¶
Mock configuration for the ScouterQueue
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Arbitrary keyword arguments to set as attributes. |
{}
|
OpsmlServerContext
¶
Source code in python/opsml/mock/_mock.pyi
OpsmlTestServer
¶
Source code in python/opsml/mock/_mock.pyi
__enter__()
¶
__exit__(exc_type, exc_value, traceback)
¶
__init__(cleanup=True, base_path=None)
¶
Instantiates the test server.
When the test server is used as a context manager, it will start the server in a background thread and set the appropriate env vars so that the client can connect to the server. The server will be stopped when the context manager exits and the env vars will be reset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cleanup
|
bool
|
Whether to cleanup the server after the test. Defaults to True. |
True
|
base_path
|
Optional[Path]
|
The base path for the server. Defaults to None. This is primarily used for testing loading attributes from a pyproject.toml file. |
None
|