MockBucket¶
- class safir.testing.gcs.MockBucket(bucket_name, expected_expiration=None, path=None)¶
Bases:
Mock
Mock version of
google.cloud.storage.bucket.Bucket
.- Parameters:
expected_expiration (
timedelta
|None
, default:None
) – The expiration that should be requested in a call togenerate_signed_url
on an underlying blob. A non-matching call will produce an assertion failure.path (
Path
|None
, default:None
) – Root of the file path for blobs, if given. If not given, a simpler mock blob will be used that only supportsgenerate_signed_url
.bucket_name (
str
)
Methods Summary
blob
(blob_name)Retrieve a mock blob.
Methods Documentation