def METHOD_NAME(
        self,
        _,
        file_path,
        lcpencrypt_output,
        expected_result,
        expected_exception=None,
        create_file=True):
    # Arrange
    integration_owner = create_autospec(spec=HasExternalIntegration)
    integration_owner.external_integration = MagicMock(return_value=self._integration)
    configuration_storage = ConfigurationStorage(integration_owner)
    configuration_factory = ConfigurationFactory()
    encryptor = LCPEncryptor(configuration_storage, configuration_factory)
    identifier = Identifier(identifier=fixtures.BOOK_IDENTIFIER)
    with configuration_factory.create(configuration_storage, self._db, LCPEncryptionConfiguration) as configuration:
        configuration.lcpencrypt_location = LCPEncryptionConfiguration.DEFAULT_LCPENCRYPT_LOCATION
        with Patcher() as patcher:
            patcher.fs.create_file(LCPEncryptionConfiguration.DEFAULT_LCPENCRYPT_LOCATION)
            if create_file:
                patcher.fs.create_file(file_path)
            with patch('subprocess.check_output') as subprocess_check_output_mock:
                subprocess_check_output_mock.return_value = lcpencrypt_output
                if expected_exception:
                    with pytest.raises(expected_exception.__class__) as exception_metadata:
                        encryptor.encrypt(self._db, file_path, identifier.identifier)
                    # Assert
                    assert exception_metadata.value == expected_exception
                else:
                    # Assert
                    result = encryptor.encrypt(self._db, file_path, identifier.identifier)
                    assert result == expected_result