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 3939 "google-auth>=1.16.0" ,
4040 "google-auth-httplib2>=0.0.3" ,
4141 "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'" ,
4244 "six>=1.13.0,<2dev" ,
4345 "uritemplate>=3.0.0,<4dev" ,
4446]
Original file line number Diff line number Diff line change 1818import google_auth_httplib2
1919import httplib2
2020import oauth2client .client
21+ import pkg_resources
2122import unittest2 as unittest
2223
2324from googleapiclient import _auth
@@ -82,14 +83,21 @@ class CredentialsWithScopes(
8283 ):
8384 pass
8485
86+ google_auth_version = pkg_resources .get_distribution ("google-auth" ).parsed_version
87+
8588 credentials = mock .Mock (spec = CredentialsWithScopes )
8689 credentials .requires_scopes = True
8790
8891 returned = _auth .with_scopes (credentials , mock .sentinel .scopes )
8992
9093 self .assertNotEqual (credentials , returned )
9194 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 )
93101
94102 def test_authorized_http (self ):
95103 credentials = mock .Mock (spec = google .auth .credentials .Credentials )
You can’t perform that action at this time.
0 commit comments