setup_wizard.tests.test_views.test_hsmsetupmixin_extendedΒΆ

Extended tests for HSM setup mixin error handling.

ClassesΒΆ

TestHsmSetupMixinValidation

Test HSM setup mixin validation methods.

TestHsmSetupMixinTokenOperations

Test HSM setup token creation and update operations.

TestHsmSetupMixinErrorHandling

Test HSM setup mixin error handling.

Module ContentsΒΆ

class setup_wizard.tests.test_views.test_hsmsetupmixin_extended.TestHsmSetupMixinValidation[source]ΒΆ

Test HSM setup mixin validation methods.

setup_method()[source]ΒΆ

Set up test fixtures.

test_validate_hsm_inputs_invalid_module_path()[source]ΒΆ

Test _validate_hsm_inputs with invalid module path characters.

test_validate_hsm_inputs_invalid_slot_non_digit()[source]ΒΆ

Test _validate_hsm_inputs with non-digit slot.

test_validate_hsm_inputs_invalid_label()[source]ΒΆ

Test _validate_hsm_inputs with invalid label characters.

test_validate_hsm_inputs_injection_attempt()[source]ΒΆ

Test _validate_hsm_inputs detects potential command injection.

test_validate_hsm_inputs_valid()[source]ΒΆ

Test _validate_hsm_inputs with all valid inputs.

class setup_wizard.tests.test_views.test_hsmsetupmixin_extended.TestHsmSetupMixinTokenOperations[source]ΒΆ

Test HSM setup token creation and update operations.

setup_method()[source]ΒΆ

Set up test fixtures.

test_assign_token_to_crypto_storage_softhsm_match(mock_get_config)[source]ΒΆ

Test _assign_token_to_crypto_storage with matching SoftHSM.

test_assign_token_to_crypto_storage_physical_match(mock_get_config)[source]ΒΆ

Test _assign_token_to_crypto_storage with matching Physical HSM.

test_assign_token_to_crypto_storage_mismatch(mock_get_config)[source]ΒΆ

Test _assign_token_to_crypto_storage with mismatched types.

test_assign_token_to_crypto_storage_exception(mock_get_config)[source]ΒΆ

Test _assign_token_to_crypto_storage handles exceptions.

test_generate_kek_and_dek_kek_failure()[source]ΒΆ

Test _generate_kek_and_dek when KEK generation fails.

test_generate_kek_and_dek_dek_failure()[source]ΒΆ

Test _generate_kek_and_dek when DEK generation fails.

test_generate_kek_and_dek_both_succeed()[source]ΒΆ

Test _generate_kek_and_dek when both succeed.

class setup_wizard.tests.test_views.test_hsmsetupmixin_extended.TestHsmSetupMixinErrorHandling[source]ΒΆ

Test HSM setup mixin error handling.

setup_method()[source]ΒΆ

Set up test fixtures.

test_raise_called_process_error()[source]ΒΆ

Test _raise_called_process_error raises correct exception.

test_add_success_message_created()[source]ΒΆ

Test _add_success_message with created token.

test_add_success_message_updated()[source]ΒΆ

Test _add_success_message with updated token.

test_handle_hsm_setup_exception_called_process_error()[source]ΒΆ

Test _handle_hsm_setup_exception with CalledProcessError.

test_handle_hsm_setup_exception_file_not_found()[source]ΒΆ

Test _handle_hsm_setup_exception with FileNotFoundError.

test_handle_hsm_setup_exception_unexpected()[source]ΒΆ

Test _handle_hsm_setup_exception with unexpected exception.

test_map_exit_code_to_message_all_known_codes()[source]ΒΆ

Test _map_exit_code_to_message for all known exit codes.

test_map_exit_code_to_message_unknown_code()[source]ΒΆ

Test _map_exit_code_to_message with unknown exit code.