示例#1
0
class BaseDriveAuth(object):
    google_user = u'*****@*****.**'
    json_str = """
    {"_module": "oauth2client.client", "_class": "OAuth2Credentials", "access_token": "asdfasdfasdfasdfasdfasdfasdf", "token_uri": "https://accounts.google.com/o/oauth2/token", "invalid": false, "client_id": "9999999999999.apps.googleusercontent.com", "id_token": {"aud": "9999999999999.apps.googleusercontent.com", "cid": "9999999999999.apps.googleusercontent.com", "iss": "accounts.google.com", "email": "*****@*****.**", "exp": 1354832924, "iat": 1354829024, "token_hash": "xXxXxXyyYyYyYyYyYy", "id": "444444444444444444444", "hd": "karmanotes.org", "verified_email": "true"}, "client_secret": "7&7&&7&7&7&7&&&&&&&&&&&(", "token_expiry": "2013-02-04T23:46:47Z", "refresh_token": "qweasdzxcrtyfghvbnuiojklm,.", "user_agent": null}
    """

    def setup(self):
        self.drive_auth = DriveAuth()
        self.drive_auth.email = self.google_user
        self.drive_auth.credentials = self.json_str
        self.drive_auth.save()

    def teardown(self):
        self.drive_auth.delete()
示例#2
0
class BaseDriveAuth(object):
    google_user = u'*****@*****.**'
    json_str = """
    {"_module": "oauth2client.client", "_class": "OAuth2Credentials", "access_token": "asdfasdfasdfasdfasdfasdfasdf", "token_uri": "https://accounts.google.com/o/oauth2/token", "invalid": false, "client_id": "9999999999999.apps.googleusercontent.com", "id_token": {"aud": "9999999999999.apps.googleusercontent.com", "cid": "9999999999999.apps.googleusercontent.com", "iss": "accounts.google.com", "email": "*****@*****.**", "exp": 1354832924, "iat": 1354829024, "token_hash": "xXxXxXyyYyYyYyYyYy", "id": "444444444444444444444", "hd": "karmanotes.org", "verified_email": "true"}, "client_secret": "7&7&&7&7&7&7&&&&&&&&&&&(", "token_expiry": "2013-02-04T23:46:47Z", "refresh_token": "qweasdzxcrtyfghvbnuiojklm,.", "user_agent": null}
    """

    def setup(self):
        self.drive_auth = DriveAuth()
        self.drive_auth.email = self.google_user
        self.drive_auth.credentials = self.json_str
        self.drive_auth.save()

    def teardown(self):
        self.drive_auth.delete()
示例#3
0
 def test_drive_auth_get(self):
     """ Test getting via DriveAuth.get() staticmethod """
     drive_auth = DriveAuth.get(email=self.google_user)
     eq_(drive_auth, self.drive_auth)
示例#4
0
 def setup(self):
     self.drive_auth = DriveAuth()
     self.drive_auth.email = self.google_user
     self.drive_auth.credentials = self.json_str
     self.drive_auth.save()
示例#5
0
 def test_drive_auth_get(self):
     """ Test getting via DriveAuth.get() staticmethod """
     drive_auth = DriveAuth.get(email=self.google_user)
     eq_(drive_auth, self.drive_auth)
示例#6
0
 def setup(self):
     self.drive_auth = DriveAuth()
     self.drive_auth.email = self.google_user
     self.drive_auth.credentials = self.json_str
     self.drive_auth.save()