request.tests.test_authentication_extendedΒΆ

Extended tests for request/authentication.py to increase coverage.

ClassesΒΆ

TestUsernamePasswordAuthenticationExtended

Extended tests for UsernamePasswordAuthentication.

TestClientCertificateAuthenticationExtended

Extended tests for ClientCertificateAuthentication.

TestCmpSharedSecretAuthentication

Tests for CMP Shared Secret Authentication.

TestIDevIDAuthentication

Tests for IDevID Authentication.

TestCompositeAuthentication

Tests for composite authentication patterns.

TestAuthenticationEdgeCases

Tests for authentication edge cases and error conditions.

Module ContentsΒΆ

class request.tests.test_authentication_extended.TestUsernamePasswordAuthenticationExtended[source]ΒΆ

Extended tests for UsernamePasswordAuthentication.

test_authenticate_device_without_est_password(device_instance)[source]ΒΆ

Test authentication fails when device has no EST password configured.

Parameters:

device_instance (dict[str, Any])

Return type:

None

test_authenticate_device_without_config(domain_instance)[source]ΒΆ

Test authentication fails when device has no onboarding or no_onboarding config.

Parameters:

domain_instance (dict[str, Any])

Return type:

None

test_authenticate_exception_during_lookup()[source]ΒΆ

Test authentication handles exceptions during device lookup.

Return type:

None

class request.tests.test_authentication_extended.TestClientCertificateAuthenticationExtended[source]ΒΆ

Extended tests for ClientCertificateAuthentication.

test_authenticate_no_client_certificate()[source]ΒΆ

Test authentication returns None when no client certificate provided.

Return type:

None

test_authenticate_certificate_not_found_in_db(device_instance)[source]ΒΆ

Test authentication fails when certificate is not found in database.

Parameters:

device_instance (dict[str, Any])

Return type:

None

test_authenticate_invalid_domain_credential(device_instance)[source]ΒΆ

Test authentication fails with invalid domain credential.

Parameters:

device_instance (dict[str, Any])

Return type:

None

class request.tests.test_authentication_extended.TestCmpSharedSecretAuthentication[source]ΒΆ

Tests for CMP Shared Secret Authentication.

test_authenticate_non_cmp_protocol()[source]ΒΆ

Test authentication raises error when protocol is not CMP.

Return type:

None

test_authenticate_no_parsed_message()[source]ΒΆ

Test authentication raises error when no parsed message.

Return type:

None

test_authenticate_invalid_message_type()[source]ΒΆ

Test authentication raises error with invalid message type.

Return type:

None

class request.tests.test_authentication_extended.TestIDevIDAuthentication[source]ΒΆ

Tests for IDevID Authentication.

test_authenticate_no_raw_message()[source]ΒΆ

Test authentication returns None when no raw_message.

Return type:

None

test_authenticate_with_valid_idevid(device_instance)[source]ΒΆ

Test authentication with valid IDevID certificate.

Parameters:

device_instance (dict[str, Any])

Return type:

None

test_authenticate_idevid_authentication_error(device_instance)[source]ΒΆ

Test authentication fails when IDevID authentication raises error.

Parameters:

device_instance (dict[str, Any])

Return type:

None

test_authenticate_no_device_associated(device_instance)[source]ΒΆ

Test authentication fails when no device is associated.

Parameters:

device_instance (dict[str, Any])

Return type:

None

test_authenticate_device_without_domain(device_instance)[source]ΒΆ

Test authentication with device that has no domain set.

Parameters:

device_instance (dict[str, Any])

Return type:

None

class request.tests.test_authentication_extended.TestCompositeAuthentication[source]ΒΆ

Tests for composite authentication patterns.

test_multiple_authentication_methods(device_instance)[source]ΒΆ

Test that first successful authentication method is used.

Parameters:

device_instance (dict[str, Any])

Return type:

None

test_authentication_with_onboarding_config(device_instance_onboarding)[source]ΒΆ

Test authentication works with onboarding config.

Parameters:

device_instance_onboarding (dict[str, Any])

Return type:

None

class request.tests.test_authentication_extended.TestAuthenticationEdgeCases[source]ΒΆ

Tests for authentication edge cases and error conditions.

test_username_password_with_special_characters(domain_instance)[source]ΒΆ

Test authentication with special characters in username/password.

Parameters:

domain_instance (dict[str, Any])

Return type:

None

test_case_sensitive_username(device_instance)[source]ΒΆ

Test that username is case-sensitive.

Parameters:

device_instance (dict[str, Any])

Return type:

None