Exemplo n.º 1
0
def delete_directory(directory_key: str) -> None:
    """Deletes a "directory" key (aka super key)
    Recursively lists all objects within a directory and deletes them, as well as the folders, if relevant
    Args:
        directory_key: The key of the directory to delete
    Raises:
        exceptions.StorageError on any unexpected error interacting with storage
    """
    try:
        keys = list_objects(directory_key)
        for key in keys:
            delete(key)
        storage.delete_directory(STORAGE_LOCATION, directory_key)
    except Exception:
        raise exceptions.StorageError(
            "Uncaught exception while performing storage delete_directory")
Exemplo n.º 2
0
 def test_delete_directory_does_nothing(self):
     s3.delete_directory("loc", "ok")