def __init__(self, method_name):
        unittest.TestCase.__init__(self, method_name)
        oauth_params_dict = {}
        for line in open('./contrib_tests/test_account.oacurl.properties'):
            line = line.strip()
            if line.startswith('#'):
                continue
            key, value = line.split('=')
            oauth_params_dict[key.strip()] = value.strip()

        consumer = oauth.Consumer(oauth_params_dict['consumerKey'],
                                  oauth_params_dict['consumerSecret'])
        token = oauth.Token(oauth_params_dict['accessToken'],
                            oauth_params_dict['accessTokenSecret'])
        user_agent = 'google-api-client-python-buzz-webapp/1.0'
        credentials = apiclient.oauth.OAuthCredentials(consumer, token,
                                                       user_agent)
        self.wrapper = SimpleWrapper(credentials=credentials)
 def test_wrapper_returns_minus_one_for_hidden_following_count(self):
     wrapper = SimpleWrapper()
     self.assertEquals(
         -1, wrapper.get_following_count(user_id='108242092577082601423'))
 def test_wrapper_returns_positive_value_for_visible_following_count(self):
     wrapper = SimpleWrapper()
     count = wrapper.get_following_count(user_id='googlebuzz')
     self.assertTrue(count > 0, "Got %s instead" % count)
 def test_wrapper_rejects_search_with_none(self):
     wrapper = SimpleWrapper()
     self.assertEquals(None, wrapper.search(None))
 def test_wrapper_rejects_search_containing_only_whitespace(self):
     wrapper = SimpleWrapper()
     self.assertEquals(None, wrapper.search(' '))
 def test_wrapper_rejects_empty_search(self):
     wrapper = SimpleWrapper()
     self.assertEquals(None, wrapper.search(''))
 def test_wrapper_rejects_none_post(self):
     wrapper = SimpleWrapper()
     self.assertEquals(None, wrapper.post(None, '108242092577082601423'))
 def test_wrapper_rejects_post_containing_only_whitespace(self):
     wrapper = SimpleWrapper()
     self.assertEquals(
         None, wrapper.post('            ', '108242092577082601423'))