def METHOD_NAME(helpers):
    """
    Test saving/loading keys where location is (not) empty.
    """
    @fhe.compiler({"x": "encrypted"})
    def f(x):
        return x**2
    with tempfile.TemporaryDirectory() as tmp_dir:
        tmp_dir_path = Path(tmp_dir)
        keys_path = tmp_dir_path / "keys"
        inputset = range(10)
        circuit = f.compile(inputset, helpers.configuration().fork(use_insecure_key_cache=False))
        with pytest.raises(ValueError) as excinfo:
            circuit.keys.load(keys_path)
        expected_message = f"Unable to load keys from {keys_path} because it doesn't exist"
        helpers.check_str(expected_message, str(excinfo.value))
        with open(keys_path, "w", encoding="utf-8") as f:
            f.write("foo")
        circuit.keys.generate()
        with pytest.raises(ValueError) as excinfo:
            circuit.keys.save(keys_path)
        expected_message = f"Unable to save keys to {keys_path} because it already exists"
        helpers.check_str(expected_message, str(excinfo.value))