def METHOD_NAME(repository, generate_directory):
    """Test the ``Repository.erase`` method."""
    repository.initialise()
    directory = generate_directory({'file_a': None})
    with open(directory / 'file_a', 'rb') as handle:
        key = repository.put_object_from_filelike(handle)
    assert repository.has_object(key)
    dirpath = repository.sandbox.abspath
    repository.erase()
    assert not pathlib.Path(dirpath).exists()
    assert not repository.is_initialised