コード例 #1
0
class TestOAuth(TestCase):
    SCOPE = "https://www.googleapis.com/auth/youtube.upload"

    def setUp(self):
        self.temppath = recipe.temppath.tempfilepath()
        self.oauth = OAuth(conf.GOOGLE_CLIENT_ID, conf.GOOGLE_CLIENT_SECRET, self.temppath)

    def test_get_scope(self):
        credentials = self.oauth.get(self.SCOPE)
        authorized_http = credentials.authorize(httplib2.Http())
        credentials.retrieve_scopes(authorized_http)
        self.assertTrue(credentials.has_scopes(self.SCOPE))
コード例 #2
0
 def setUp(self):
     self.temppath = recipe.temppath.tempfilepath()
     self.oauth = OAuth(conf.GOOGLE_CLIENT_ID, conf.GOOGLE_CLIENT_SECRET, self.temppath)