Пример #1
0
def delete(key: str) -> None:
    """Deletes an object in S3 with cache write-thru
    Args:
        key: The key of the object being deleted in S3
    Raises:
        exceptions.StorageError on any unexpected error interacting with storage
    """
    try:
        storage.delete(STORAGE_LOCATION, key)
        redis.cache_delete(key)
    except Exception:
        raise exceptions.StorageError(
            "Uncaught exception while performing storage delete")
Пример #2
0
 def test_delete_calls_with_correct_params(self, mock_delete_object):
     s3.delete("test", "thing")
     mock_delete_object.assert_called_once_with(Bucket="test", Key="thing")