File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 39
39
"google-auth>=1.16.0" ,
40
40
"google-auth-httplib2>=0.0.3" ,
41
41
"google-api-core>=1.21.0,<2dev" ,
42
+ # rsa version 4.5 is the last version that is compatible with Python 2.7
43
+ "rsa==4.5;python_version<'3'" ,
42
44
"six>=1.13.0,<2dev" ,
43
45
"uritemplate>=3.0.0,<4dev" ,
44
46
]
Original file line number Diff line number Diff line change 18
18
import google_auth_httplib2
19
19
import httplib2
20
20
import oauth2client .client
21
+ import pkg_resources
21
22
import unittest2 as unittest
22
23
23
24
from googleapiclient import _auth
@@ -82,14 +83,21 @@ class CredentialsWithScopes(
82
83
):
83
84
pass
84
85
86
+ google_auth_version = pkg_resources .get_distribution ("google-auth" ).parsed_version
87
+
85
88
credentials = mock .Mock (spec = CredentialsWithScopes )
86
89
credentials .requires_scopes = True
87
90
88
91
returned = _auth .with_scopes (credentials , mock .sentinel .scopes )
89
92
90
93
self .assertNotEqual (credentials , returned )
91
94
self .assertEqual (returned , credentials .with_scopes .return_value )
92
- credentials .with_scopes .assert_called_once_with (mock .sentinel .scopes )
95
+
96
+ # The `default_scopes` argument was added in google-auth==1.25.0
97
+ if google_auth_version >= pkg_resources .parse_version ("1.25.0" ):
98
+ credentials .with_scopes .assert_called_once_with (mock .sentinel .scopes , default_scopes = None )
99
+ else :
100
+ credentials .with_scopes .assert_called_once_with (mock .sentinel .scopes )
93
101
94
102
def test_authorized_http (self ):
95
103
credentials = mock .Mock (spec = google .auth .credentials .Credentials )
You can’t perform that action at this time.
0 commit comments