MockBlob#
- class safir.testing.gcs.MockBlob(name, expected_expiration=None)#
Bases:
Mock
Mock version of
google.cloud.storage.blob.Blob
.- Parameters:
Methods Summary
generate_signed_url
(*, version, expiration, ...)Generate a mock signed URL for testing.
Methods Documentation
- generate_signed_url(*, version, expiration, method, response_type=None, credentials=None)#
Generate a mock signed URL for testing.
- Parameters:
version (
str
) – Must bev4
.expiration (
timedelta
) – Must match theexpected_expiration
argument to the constructor if it was given.method (
str
) – Must beGET
.response_type (
Optional
[str
], default:None
) – May be anything and is ignored.credentials (
Optional
[Any
], default:None
) – May be anything and is ignored.
- Returns:
Always returns
https://example.com/name
where name is the name of the blob.- Return type: