File tree 2 files changed +9
-19
lines changed
2 files changed +9
-19
lines changed Original file line number Diff line number Diff line change 37
37
from google .cloud .storage ._signing import generate_signed_url_v4
38
38
from google .cloud .storage .acl import BucketACL
39
39
from google .cloud .storage .acl import DefaultObjectACL
40
- from google .cloud .storage .blob import _SIGNED_URL_V2_DEFAULT_MESSAGE
41
40
from google .cloud .storage .blob import Blob
42
41
from google .cloud .storage .notification import BucketNotification
43
42
from google .cloud .storage .notification import NONE_PAYLOAD_FORMAT
@@ -2056,7 +2055,6 @@ def generate_signed_url(
2056
2055
"""
2057
2056
if version is None :
2058
2057
version = "v2"
2059
- warnings .warn (DeprecationWarning (_SIGNED_URL_V2_DEFAULT_MESSAGE ))
2060
2058
elif version not in ("v2" , "v4" ):
2061
2059
raise ValueError ("'version' must be either 'v2' or 'v4'" )
2062
2060
Original file line number Diff line number Diff line change 14
14
15
15
import datetime
16
16
import unittest
17
- import warnings
18
17
19
18
import mock
20
19
@@ -2623,22 +2622,15 @@ def _generate_signed_url_helper(
2623
2622
)
2624
2623
2625
2624
with mock .patch (to_patch ) as signer :
2626
- with warnings .catch_warnings (record = True ) as warned :
2627
- signed_uri = bucket .generate_signed_url (
2628
- expiration = expiration ,
2629
- api_access_endpoint = api_access_endpoint ,
2630
- method = method ,
2631
- credentials = credentials ,
2632
- headers = headers ,
2633
- query_parameters = query_parameters ,
2634
- version = version ,
2635
- )
2636
-
2637
- if version is None :
2638
- self .assertEqual (len (warned ), 1 )
2639
- self .assertIs (warned [0 ].category , DeprecationWarning )
2640
- else :
2641
- self .assertEqual (len (warned ), 0 )
2625
+ signed_uri = bucket .generate_signed_url (
2626
+ expiration = expiration ,
2627
+ api_access_endpoint = api_access_endpoint ,
2628
+ method = method ,
2629
+ credentials = credentials ,
2630
+ headers = headers ,
2631
+ query_parameters = query_parameters ,
2632
+ version = version ,
2633
+ )
2642
2634
2643
2635
self .assertEqual (signed_uri , signer .return_value )
2644
2636
You can’t perform that action at this time.
0 commit comments