Esempio n. 1
0
 def testValidHostName(self):
   mock_http = atom.mock_http.MockHttpClient()
   response = atom.mock_http.MockResponse(body='<entry/>', status=200,
       reason='OK')
   mock_http.add_response(response, 'GET',
       'https://www.google.com/calendar/feeds/default/allcalendars/full')
   self.cal_client.ssl = True
   self.cal_client.http_client = mock_http
   self.cal_client.SetAuthSubToken('foo')
   self.assertEqual(str(self.cal_client.token_store.find_token(
       'https://www.google.com/calendar/feeds/default/allcalendars/full')),
       'AuthSub token=foo')
   resp = self.cal_client.Get('/calendar/feeds/default/allcalendars/full')
   self.assertTrue(resp is not None)
 def testValidHostName(self):
   mock_http = atom.mock_http.MockHttpClient()
   response = atom.mock_http.MockResponse(body='<entry/>', status=200,
       reason='OK')
   mock_http.add_response(response, 'GET',
       'https://www.google.com/calendar/feeds/default/allcalendars/full')
   self.cal_client.ssl = True
   self.cal_client.http_client = mock_http
   self.cal_client.SetAuthSubToken('foo')
   self.assertEquals(str(self.cal_client.token_store.find_token(
       'https://www.google.com/calendar/feeds/default/allcalendars/full')),
       'AuthSub token=foo')
   resp = self.cal_client.Get('/calendar/feeds/default/allcalendars/full')
   self.assert_(resp is not None)
Esempio n. 3
0
 def testValidHostName(self):
     mock_http = atom.mock_http.MockHttpClient()
     response = atom.mock_http.MockResponse(body="<entry/>", status=200, reason="OK")
     mock_http.add_response(response, "GET", "https://www.google.com/calendar/feeds/default/allcalendars/full")
     self.cal_client.ssl = True
     self.cal_client.http_client = mock_http
     self.cal_client.SetAuthSubToken("foo")
     self.assertEquals(
         str(
             self.cal_client.token_store.find_token(
                 "https://www.google.com/calendar/feeds/default/allcalendars/full"
             )
         ),
         "AuthSub token=foo",
     )
     resp = self.cal_client.Get("/calendar/feeds/default/allcalendars/full")
     self.assert_(resp is not None)