コード例 #1
0
 def test_new(self):
   gp = GooglePlusPage.new(self.handler, auth_entity=self.auth_entity)
   self.assertEqual(self.auth_entity, gp.auth_entity.get())
   self.assertEqual('987', gp.key.string_id())
   self.assertEqual('http://pi.ct/ure?sz=50&sz=128', gp.picture)  # overridden sz
   self.assertEqual('Mr. G P', gp.name)
   self.assertEqual('http://mr/g/p', gp.url)
   self.assertEqual('http://mr/g/p', gp.silo_url())
コード例 #2
0
 def setUp(self):
   super(GooglePlusTest, self).setUp()
   self.handler.messages = []
   self.auth_entity = oauth_googleplus.GooglePlusAuth(
     id='my_string_id',
     creds_json=gr_test_googleplus.CREDS_JSON,
     user_json=json.dumps({'id': '987',
                           'displayName': 'Mr. G P',
                           'url': 'http://mr/g/p',
                           'image': {'url': 'http://pi.ct/ure?sz=50'},
                           }))
   self.auth_entity.put()
   self.gp = GooglePlusPage.new(self.handler, auth_entity=self.auth_entity)
コード例 #3
0
ファイル: test_googleplus.py プロジェクト: tantek/bridgy
 def setUp(self):
     super(GooglePlusTest, self).setUp()
     self.handler.messages = []
     self.auth_entity = oauth_googleplus.GooglePlusAuth(
         id="my_string_id",
         creds_json=gr_test_googleplus.CREDS_JSON,
         user_json=json.dumps(
             {
                 "id": "987",
                 "displayName": "Mr. G P",
                 "url": "http://mr/g/p",
                 "image": {"url": "http://pi.ct/ure?sz=50"},
             }
         ),
     )
     self.auth_entity.put()
     self.gp = GooglePlusPage.new(self.handler, auth_entity=self.auth_entity)
コード例 #4
0
 def test_canonicalize_syndication_url(self):
   gp = GooglePlusPage.new(self.handler, auth_entity=self.auth_entity)
   self.assertEqual(
     'https://plus.google.com/first.last/1234',
     gp.canonicalize_syndication_url('http://plus.google.com/first.last/1234'))