request.tests.test_gds_push_serviceΒΆ
Tests for GDS Push service.
ClassesΒΆ
Test cases for GdsPushService. |
|
Additional test cases to reach 70% coverage. |
FunctionsΒΆ
Create a mock CA with CRL. |
|
|
Create a mock domain. |
Create a mock truststore. |
|
|
Create a mock server certificate in the truststore. |
|
Create a mock OPC UA device with proper configuration. |
|
Create a mock domain credential for the device. |
Module ContentsΒΆ
- request.tests.test_gds_push_service.mock_server_certificate(mock_truststore)[source]ΒΆ
Create a mock server certificate in the truststore.
- request.tests.test_gds_push_service.mock_opc_device(mock_domain, mock_truststore, mock_server_certificate)[source]ΒΆ
Create a mock OPC UA device with proper configuration.
- request.tests.test_gds_push_service.mock_domain_credential(mock_opc_device, mock_domain)[source]ΒΆ
Create a mock domain credential for the device.
- class request.tests.test_gds_push_service.TestGdsPushService[source]ΒΆ
Test cases for GdsPushService.
- test_init_secure_mode(mock_opc_device, mock_domain_credential, mock_truststore)[source]ΒΆ
Test initialization in secure mode.
- test_init_device_missing_ip(mock_domain, mock_truststore)[source]ΒΆ
Test initialization with device missing IP address.
- test_init_device_missing_port(mock_domain, mock_truststore)[source]ΒΆ
Test initialization with device missing OPC server port.
- test_init_device_no_onboarding_config(mock_domain)[source]ΒΆ
Test initialization with device missing onboarding config.
- test_init_device_empty_truststore(mock_domain)[source]ΒΆ
Test initialization with empty OPC truststore.
- test_init_no_domain_credential(mock_domain, mock_truststore)[source]ΒΆ
Test initialization when no domain credential exists.
- async test_build_ca_chain(mock_sync_to_async, mock_opc_device, mock_ca_with_crl)[source]ΒΆ
Test building CA certificate chain.
- async test_discover_server_success(mock_client_class, mock_opc_device)[source]ΒΆ
Test successful server discovery.
- async test_discover_server_connection_failure(mock_client_class, mock_opc_device)[source]ΒΆ
Test server discovery with connection failure.
- async test_update_trustlist_success(mock_sync_to_async, mock_client_class, mock_opc_device, mock_domain_credential, mock_ca_with_crl)[source]ΒΆ
Test successful trustlist update.
- async test_update_trustlist_connection_failure(mock_client_class, mock_opc_device, mock_domain_credential)[source]ΒΆ
Test trustlist update with connection failure.
- test_validate_client_certificate_valid(mock_opc_device)[source]ΒΆ
Test client certificate validation with valid certificate.
- test_validate_client_certificate_expired(mock_opc_device)[source]ΒΆ
Test client certificate validation with expired certificate.
- test_validate_client_certificate_missing_key_usage(mock_opc_device)[source]ΒΆ
Test client certificate validation with missing key usage.
- test_extract_application_uri_success(mock_opc_device)[source]ΒΆ
Test successful application URI extraction.
- test_extract_application_uri_missing(mock_opc_device)[source]ΒΆ
Test application URI extraction with missing URI.
- test_verify_certificate_key_match_success(mock_opc_device)[source]ΒΆ
Test successful certificate and key match verification.
- test_verify_certificate_key_match_failure(mock_opc_device)[source]ΒΆ
Test certificate and key match verification with mismatch.
- async test_update_server_certificate_success(mock_client_class, mock_opc_device, mock_domain_credential, mock_ca_with_crl)[source]ΒΆ
Test successful server certificate update.
- async test_update_server_certificate_no_groups(mock_client_class, mock_opc_device, mock_domain_credential)[source]ΒΆ
Test server certificate update with no certificate groups found.
- async test_discover_certificate_groups_success(mock_opc_device)[source]ΒΆ
Test successful certificate groups discovery.
- async test_update_single_certificate_success(mock_opc_device, mock_domain_credential)[source]ΒΆ
Test successful single certificate update.
- async test_get_client_credentials_no_credential(mock_opc_device, mock_domain_credential)[source]ΒΆ
Test client credentials retrieval with no domain credential.
- async test_discover_trustlist_nodes_success(mock_opc_device)[source]ΒΆ
Test successful trustlist nodes discovery.
- async test_update_single_trustlist_success(mock_opc_device)[source]ΒΆ
Test successful single trustlist update.
- async test_update_truststore_no_truststore_configured(mock_opc_device)[source]ΒΆ
Test truststore update with no truststore configured.
- async test_update_server_certificate_connection_error(mock_opc_device, mock_domain_credential)[source]ΒΆ
Test server certificate update with connection error.
- async test_validate_client_certificate_raises_error(mock_opc_device)[source]ΒΆ
Test certificate validation raises error for invalid certificate.
- async test_discover_certificate_groups_empty(mock_opc_device)[source]ΒΆ
Test certificate groups discovery with no groups.
- async test_analyze_endpoints_with_none_policy(mock_opc_device)[source]ΒΆ
Test endpoint analysis with None security policy.
- async test_update_single_trustlist_open_failure(mock_opc_device)[source]ΒΆ
Test trustlist update with open failure.
- async test_analyze_endpoints_with_secure_policy(mock_opc_device)[source]ΒΆ
Test endpoint analysis with secure policy.
- class request.tests.test_gds_push_service.TestGdsPushServiceAdditionalCoverage[source]ΒΆ
Additional test cases to reach 70% coverage.
- async test_build_ca_chain_no_domain(mock_opc_device)[source]ΒΆ
Test building CA chain with no domain.
- test_validate_client_certificate_missing_san(mock_opc_device)[source]ΒΆ
Test validating client certificate with missing SAN.