def METHOD_NAME(
    mock_init, mock_get_hsm_pool, mock_load_security_module
):
    poolsize = 20
    mock_init.return_value = None
    mock_get_hsm_pool.return_value = None
    mock_load_security_module.side_effect = Exception(
        "Mocked Exception to be caught"
    )
    # hook for local provider test
    security_provider = SecurityProvider()
    security_provider.config = {
        "default": {
            "crypted": "FALSE",
            "module": "linotp.lib.security.default.DefaultSecurityModule",
            "poolsize": poolsize,
        }
    }
    security_provider.hsmpool = {"default": ""}
    created_pool = security_provider.createHSMPool("default", None, None)
    assert len(created_pool) == poolsize
    # test the content of one of the connections
    assert created_pool[0]["obj"] == None
    assert (
        created_pool[0]["error"]
        == "'default': " + mock_load_security_module.side_effect.__repr__()
    )
    # check that all elements are the same:
    first_elem = created_pool[0]
    assert all([elem == first_elem for elem in created_pool])