Added oauth tokens for discoveryclientlibrarytest@gmail.com. First authentication test passes but it shouldn't need authentication. It seems we're adding a spurious @self to the URL

This commit is contained in:
ade@google.com
2010-10-05 00:29:51 -07:00
parent 59cd951fc5
commit 6a05e7d3dc
3 changed files with 78 additions and 8 deletions

10
TODO
View File

@@ -11,12 +11,9 @@ TODO
- Caching of discovery doc
- Add in 'Extra Discovery' for pagination
- Layered user-agent header, ala 'my-buzz-client/1.0 google-api-python-client/0.2 httplib2/0.6'
- Implement requests as Command objects, either for immediate
execution, or for batching.
- Requests for multiple APIs at one time.
@@ -24,3 +21,10 @@ TODO
DONE
====
- Implement requests as Command objects, either for immediate
execution, or for batching.
- Add in 'Extra Discovery' for pagination

View File

@@ -0,0 +1,50 @@
ccopy_reg
_reconstructor
p0
(capiclient.oauth
OAuthCredentials
p1
c__builtin__
object
p2
Ntp3
Rp4
(dp5
S'token'
p6
g0
(coauth2
Token
p7
g2
Ntp8
Rp9
(dp10
S'secret'
p11
S'tsAddOKXxs7dypwkRTCSAvPV'
p12
sS'key'
p13
S'1/Krdi6C3n47g2ny13MdnZbj7AS77JdgaMVg2fDY7ZmwI'
p14
sbsS'consumer'
p15
g0
(coauth2
Consumer
p16
g2
Ntp17
Rp18
(dp19
g11
S'anonymous'
p20
sg13
g20
sbsS'user_agent'
p21
S'google-api-client-python-buzz-cmdline/1.0'
p22
sb.

View File

@@ -16,6 +16,7 @@ __author__ = 'ade@google.com (Ade Oshineye)'
from apiclient.discovery import build
import httplib2
import logging
import pickle
import os
import unittest
@@ -87,14 +88,29 @@ class BuzzFunctionalTest(unittest.TestCase):
class BuzzAuthenticatedFunctionalTest(unittest.TestCase):
def IGNORE__test_can_list_groups_belonging_to_user(self):
buzz = build('buzz', 'v1')
groups = buzz.groups().list(userId='googlebuzz').execute()
def __init__(self, method_name):
unittest.TestCase.__init__(self, method_name)
credentials_dir = os.path.join(logging.os.path.dirname(__file__), './data')
f = file(os.path.join(credentials_dir, 'buzz_credentials.dat'), 'r')
credentials = pickle.loads(f.read())
f.close()
self.assertTrue(len(groups) > 1)
self.http = credentials.authorize(httplib2.Http())
def test_can_list_groups_belonging_to_user(self):
# TODO(ade) This should not require authentication. It does because we're adding a spurious @self to the URL
buzz = build('buzz', 'v1', http=self.http)
groups = buzz.groups().list(userId='108242092577082601423').execute()
# This should work as long as no-one edits the groups for this test account
expected_default_number_of_groups = 4
self.assertEquals(expected_default_number_of_groups, len(groups['items']))
def IGNORE__test_can_get_followees_of_user(self):
buzz = build('buzz', 'v1')
# This currently fails with:
# Attempting to access self view of a different user.
# and URL:
buzz = build('buzz', 'v1', http=self.http)
following = buzz.groups().get(userId='googlebuzz', groupId='@following').execute()
self.assertEquals(17, len(following))