@@ -101,6 +101,18 @@ def test_w_custom_fields(self):
101
101
generation = generation )
102
102
103
103
104
+ class Test_generate_signed_url_exception (unittest2 .TestCase ):
105
+ def test_with_google_credentials (self ):
106
+ import time
107
+ from gcloud .credentials import generate_signed_url
108
+ RESOURCE = '/name/path'
109
+
110
+ credentials = _GoogleCredentials ()
111
+ expiration = int (time .time () + 5 )
112
+ self .assertRaises (AttributeError , generate_signed_url , credentials ,
113
+ resource = RESOURCE , expiration = expiration )
114
+
115
+
104
116
class Test__get_signed_query_params (unittest2 .TestCase ):
105
117
106
118
def _callFUT (self , credentials , expiration , string_to_sign ):
@@ -110,8 +122,6 @@ def _callFUT(self, credentials, expiration, string_to_sign):
110
122
111
123
def test_it (self ):
112
124
import base64
113
- from gcloud ._testing import _Monkey
114
- from gcloud import credentials as MUT
115
125
116
126
SIG_BYTES = b'DEADBEEF'
117
127
ACCOUNT_NAME = object ()
@@ -226,6 +236,12 @@ def sign_blob(self, bytes_to_sign):
226
236
return None , self ._sign_result
227
237
228
238
239
+ class _GoogleCredentials (object ):
240
+
241
+ def __init__ (self , service_account_email = 'testing@example.com' ):
242
+ self .service_account_email = service_account_email
243
+
244
+
229
245
class _Client (object ):
230
246
231
247
def __init__ (self ):
0 commit comments