Lines Matching refs:http
10 # http://www.apache.org/licenses/LICENSE-2.0
68 from googleapiclient.http import build_http
69 from googleapiclient.http import BatchHttpRequest
70 from googleapiclient.http import HttpMock
71 from googleapiclient.http import HttpMockSequence
72 from googleapiclient.http import MediaFileUpload
73 from googleapiclient.http import MediaIoBaseUpload
74 from googleapiclient.http import MediaUpload
75 from googleapiclient.http import MediaUploadProgress
76 from googleapiclient.http import tunnel_patch
227 fake_root_desc = {'rootUrl': 'http://root/',
249 'http://root/upload/fake/fake-path/')
258 ten_gb, 'http://root/upload/fake/fake-path/')
275 'http://root/upload/fake/fake-path/')
286 ten_gb, 'http://root/upload/fake/fake-path/')
376 self.fail("should have raised a TypeError exception over missing http=.")
381 self.http = HttpMock(datafile('malformed.json'), {'status': '200'})
383 plus = build('plus', 'v1', http=self.http, cache_discovery=False)
389 http = HttpMockSequence([
394 plus = build('plus', 'v1', http=http, cache_discovery=False)
397 http = HttpMock(datafile('plus.json'), {'status': '200'})
400 'plus', 'v1', http=http, credentials=mock.sentinel.credentials)
439 self.assertIsInstance(plus._http.http, httplib2.Http)
440 self.assertIsInstance(plus._http.http.timeout, int)
441 self.assertGreater(plus._http.http.timeout, 0)
445 # Cleanup auth field, so we would use plain http client
454 self.assertIsInstance(plus._http, httplib2.Http)
459 http = HttpMock()
462 discovery, base="https://www.googleapis.com/", http=http)
463 self.assertEquals(plus._http, http)
469 self.assertIsInstance(plus._http, httplib2.Http)
487 http = HttpMockSequence([
490 zoo = build('zoo', 'v1', http=http, developerKey=None,
491 discoveryServiceUrl='http://example.com')
494 self.assertEqual(e.uri, 'http://example.com?userIp=10.0.0.1')
500 http = HttpMockSequence([
503 zoo = build('zoo', 'v1', http=http, developerKey=None,
504 discoveryServiceUrl='http://example.com')
507 self.assertEqual(e.uri, 'http://example.com')
513 http = HttpMockSequence([
516 zoo = build('zoo', 'v1', http=http, developerKey='foo',
517 discoveryServiceUrl='http://example.com')
520 self.assertEqual(e.uri, 'http://example.com?key=foo')
523 http = HttpMockSequence([
527 zoo = build('zoo', 'v1', http=http, cache_discovery=False)
547 self.http = HttpMock(datafile('plus.json'), {'status': '200'})
551 plus = build('plus', 'v1', http=self.http)
569 self.http = HttpMock(None, {'status': '200'})
571 plus = build('plus', 'v1', http=self.http)
599 self.http = HttpMock(datafile('plus.json'), {'status': '200'})
601 plus = build('plus', 'v1', http=self.http)
617 self.http = HttpMock(None, {'status': '200'})
619 plus = build('plus', 'v1', http=self.http)
631 self.http = HttpMock(datafile('plus.json'), {'status': '200'})
632 plus = build('plus', 'v1', http=self.http)
674 http = HttpMock(datafile('zoo.json'), {'status': '200'})
675 zoo = build('zoo', 'v1', http=http)
696 http = HttpMock(datafile('zoo.json'), {'status': '200'})
697 zoo = build('zoo', 'v1', http=http)
706 http = HttpMock(datafile('zoo.json'), {'status': '200'})
707 zoo = build('zoo', 'v1', http=http)
715 http = HttpMock(datafile('zoo.json'), {'status': '200'})
716 zoo = build('zoo', 'v1', http=http)
725 http = HttpMock(datafile('zoo.json'), {'status': '200'})
726 zoo = build('zoo', 'v1', http=http)
735 http = HttpMock(datafile('zoo.json'), {'status': '200'})
736 zoo = build('zoo', 'v1', http=http)
742 self.http = HttpMock(datafile('zoo.json'), {'status': '200'})
744 zoo = build('zoo', 'v1', http=self.http)
750 self.http = HttpMock(datafile('plus.json'), {'status': '200'})
752 plus = build('plus', 'v1', http=self.http)
758 http = HttpMockSequence([
762 http = tunnel_patch(http)
763 zoo = build('zoo', 'v1', http=http, cache_discovery=False)
767 self.assertTrue('x-http-method-override' in resp)
770 self.http = HttpMock(datafile('plus.json'), {'status': '200'})
771 plus = build('plus', 'v1', http=self.http)
795 # Should be an ordinary httplib2.Http instance and not AuthorizedHttp.
796 self.assertIsInstance(service._http, httplib2.Http)
801 self.http = HttpMock(datafile('zoo.json'), {'status': '200'})
802 zoo = build('zoo', 'v1', http=self.http)
812 self.http = HttpMock(datafile('zoo.json'), {'status': '200'})
813 zoo = build('zoo', 'v1', http=self.http)
822 self.http = HttpMock(datafile('zoo.json'), {'status': '200'})
823 zoo = build('zoo', 'v1', http=self.http)
830 self.http = HttpMock(datafile('zoo.json'), {'status': '200'})
831 zoo = build('zoo', 'v1', http=self.http)
839 self.http = HttpMock(datafile('zoo.json'), {'status': '200'})
840 zoo = build('zoo', 'v1', http=self.http)
845 self.http = HttpMock(datafile('zoo.json'), {'status': '200'})
846 zoo = build('zoo', 'v1', http=self.http)
852 self.http = HttpMock(datafile('zoo.json'), {'status': '200'})
853 zoo = build('zoo', 'v1', http=self.http)
868 self.http = HttpMock(datafile('zoo.json'), {'status': '200'})
869 zoo = build('zoo', 'v1', http=self.http)
879 self.http = HttpMock(datafile('zoo.json'), {'status': '200'})
880 zoo = build('zoo', 'v1', http=self.http)
897 self.http = HttpMock(datafile('zoo.json'), {'status': '200'})
898 zoo = build('zoo', 'v1', http=self.http)
913 self.http = HttpMock(datafile('zoo.json'), {'status': '200'})
914 zoo = build('zoo', 'v1', http=self.http)
939 self.http = HttpMock(datafile('zoo.json'), {'status': '200'})
940 zoo = build('zoo', 'v1', http=self.http)
946 self.http = HttpMock(datafile('zoo.json'), {'status': '200'})
947 zoo = build('zoo', 'v1', http=self.http)
961 http = HttpMockSequence([
963 'location': 'http://upload.example.com'}, ''),
965 'location': 'http://upload.example.com/2'}, ''),
967 'location': 'http://upload.example.com/3',
970 'location': 'http://upload.example.com/4',
975 status, body = request.next_chunk(http=http)
982 self.assertEquals(request.resumable_uri, 'http://upload.example.com/2')
987 status, body = request.next_chunk(http=http)
988 self.assertEquals(request.resumable_uri, 'http://upload.example.com/3')
993 status, body = request.next_chunk(http=http)
994 self.assertEquals(request.resumable_uri, 'http://upload.example.com/4')
999 status, body = request.next_chunk(http=http)
1006 self.http = HttpMock(datafile('zoo.json'), {'status': '200'})
1007 zoo = build('zoo', 'v1', http=self.http)
1018 http = HttpMockSequence([
1020 'location': 'http://upload.example.com'}, ''),
1022 'location': 'http://upload.example.com/2',
1025 'location': 'http://upload.example.com/3',
1030 status, body = request.next_chunk(http=http)
1037 self.assertEquals(request.resumable_uri, 'http://upload.example.com/2')
1042 status, body = request.next_chunk(http=http)
1043 self.assertEquals(request.resumable_uri, 'http://upload.example.com/3')
1048 status, body = request.next_chunk(http=http)
1054 self.http = HttpMock(datafile('zoo.json'), {'status': '200'})
1055 zoo = build('zoo', 'v1', http=self.http)
1063 http = HttpMockSequence([
1065 'location': 'http://upload.example.com'}, ''),
1067 'location': 'http://upload.example.com/2',
1070 'location': 'http://upload.example.com/3',
1075 body = request.execute(http=http)
1080 self.http = HttpMock(datafile('zoo.json'), {'status': '200'})
1081 zoo = build('zoo', 'v1', http=self.http)
1086 http = HttpMockSequence([
1088 'location': 'http://upload.example.com'}, ''),
1092 request.execute(http=http)
1099 self.http = HttpMock(datafile('zoo.json'), {'status': '200'})
1100 zoo = build('zoo', 'v1', http=self.http)
1105 http = HttpMockSequence([
1107 'location': 'http://upload.example.com'}, ''),
1111 self.assertRaises(HttpError, request.execute, http=http)
1114 http = HttpMockSequence([
1121 status, body = request.next_chunk(http=http)
1127 http = HttpMockSequence([
1130 self.assertRaises(HttpError, request.execute, http=http)
1134 http = HttpMockSequence([
1137 status, body = request.next_chunk(http=http)
1141 self.http = HttpMock(datafile('zoo.json'), {'status': '200'})
1142 zoo = build('zoo', 'v1', http=self.http)
1152 http = HttpMockSequence([
1154 'location': 'http://upload.example.com'}, ''),
1156 'location': 'http://upload.example.com/2',
1161 body = request.execute(http=http)
1165 self.http = HttpMock(datafile('zoo.json'), {'status': '200'})
1166 zoo = build('zoo', 'v1', http=self.http)
1176 http = HttpMockSequence([
1178 'location': 'http://upload.example.com'}, ''),
1183 body = request.execute(http=http)
1188 http = HttpMockSequence([
1190 'location': 'http://upload.example.com'}, ''),
1194 self.http = HttpMock(datafile('zoo.json'), {'status': '200'})
1195 zoo = build('zoo', 'v1', http=self.http)
1217 status, body = request.next_chunk(http=http)
1224 self.http = HttpMock(datafile('zoo.json'), {'status': '200'})
1225 zoo = build('zoo', 'v1', http=self.http)
1258 http = HttpMockSequence([
1260 'location': 'http://upload.example.com'}, ''),
1264 self.assertRaises(NotImplementedError, request.next_chunk, http=http)
1269 http = HttpMockSequence([
1271 'location': 'http://upload.example.com'}, ''),
1275 self.http = HttpMock(datafile('zoo.json'), {'status': '200'})
1276 zoo = build('zoo', 'v1', http=self.http)
1285 status, body = request.next_chunk(http=http)
1292 http = HttpMockSequence([
1294 'location': 'http://upload.example.com'}, ''),
1298 self.http = HttpMock(datafile('zoo.json'), {'status': '200'})
1299 zoo = build('zoo', 'v1', http=self.http)
1310 http=http)
1312 http = HttpMockSequence([
1318 request.next_chunk(http=http)
1346 http = HttpMock(datafile('zoo.json'), {'status': '200'})
1347 zoo = build('zoo', 'v1', http=http)
1387 http = build_http()
1388 original_request = http.request
1393 http.request = wrapped_request
1394 return http
1410 http = self._dummy_zoo_request()
1411 http = credentials.authorize(http)
1412 self.assertTrue(hasattr(http.request, 'credentials'))
1414 zoo = build('zoo', 'v1', http=http)
1423 self.http = HttpMock(datafile('zoo.json'), {'status': '200'})
1424 zoo = build('zoo', 'v1', http=self.http)
1433 http = HttpMockSequence([
1435 'location': 'http://upload.example.com'}, ''),
1437 'location': 'http://upload.example.com/2',
1441 status, body = request.next_chunk(http=http)
1450 self.http = HttpMock(datafile('tasks.json'), {'status': '200'})
1451 tasks = build('tasks', 'v1', http=self.http)
1456 self.http = HttpMock(datafile('tasks.json'), {'status': '200'})
1457 tasks = build('tasks', 'v1', http=self.http)
1464 self.http = HttpMock(datafile('tasks.json'), {'status': '200'})
1465 tasks = build('tasks', 'v1', http=self.http)
1474 self.http = HttpMock(datafile('bigquery.json'), {'status': '200'})
1475 bigquery = build('bigquery', 'v2', http=self.http)
1484 self.http = HttpMock(datafile('logging.json'), {'status': '200'})
1485 logging = build('logging', 'v2', http=self.http)
1493 self.http = HttpMock(datafile('latitude.json'), {'status': '200'})
1494 service = build('latitude', 'v1', http=self.http)
1498 self.http = HttpMock(datafile('drive.json'), {'status': '200'})
1499 drive = build('drive', 'v3', http=self.http)
1504 self.http = HttpMock(datafile('drive.json'), {'status': '200'})
1505 drive = build('drive', 'v3', http=self.http)
1517 http = HttpMock(datafile('zoo.json'), {'status': '200'})
1518 zoo = build('zoo', 'v1', http=http)
1526 http = HttpMockSequence([
1529 response = request.execute(http=http)