request.tests.cmp_mock_serverΒΆ
CMP Mock Server that integrates CMP factory and key generation factory.
AttributesΒΆ
ClassesΒΆ
HTTP handler that captures and analyzes CMP requests. |
|
Mock CMP server that integrates with CMP and key generation factories. |
Module ContentsΒΆ
- class request.tests.cmp_mock_server.CMPMockRequestHandler(request, client_address, server)[source]ΒΆ
Bases:
http.server.BaseHTTPRequestHandler,trustpoint.logger.LoggerMixinHTTP handler that captures and analyzes CMP requests.
- class request.tests.cmp_mock_server.CMPMockServer(cmp_factory=None, keygen_factory=None, host='localhost', port=8443)[source]ΒΆ
Bases:
trustpoint.logger.LoggerMixinMock CMP server that integrates with CMP and key generation factories.
- Parameters:
host (str)
port (int)
- generate_key_if_needed(temp_dir, context)[source]ΒΆ
Generate key using the key generation factory if provided.
- Parameters:
temp_dir (str)
context (dict[str, Any])
- Return type:
bool
- execute_cmp_command(temp_dir, context)[source]ΒΆ
Execute CMP command using the CMP factory.
- Parameters:
temp_dir (str)
context (dict[str, Any])
- Return type:
bool