# Path: apitools/base/py/http_wrapper.py
# RESUME_INCOMPLETE = 308
# TOO_MANY_REQUESTS = 429
# _REDIRECT_STATUS_CODES = (
#     http_client.MOVED_PERMANENTLY,
#     http_client.FOUND,
#     http_client.SEE_OTHER,
#     http_client.TEMPORARY_REDIRECT,
#     RESUME_INCOMPLETE,
# )
# def _Httplib2Debuglevel(http_request, level, http=None):
#   def __init__(self, url='', http_method='GET', headers=None, body=''):
#   def loggable_body(self):
#   def loggable_body(self, value):
#   def body(self):
#   def body(self, value):
#   def __len__(self):
#   def length(self):
#     def ProcessContentRange(content_range):
#   def status_code(self):
#   def retry_after(self):
#   def is_redirect(self):
# def CheckResponse(response):
# def RebuildHttpConnections(http):
# def RethrowExceptionHandler(*unused_args):
# def HandleExceptionsAndRebuildHttpConnections(retry_args):
# def MakeRequest(http, http_request, retries=7, redirections=5,
#                 retry_func=HandleExceptionsAndRebuildHttpConnections,
#                 check_response_func=CheckResponse):
# def _MakeRequestNoRetry(http, http_request, redirections=5,
#                         check_response_func=CheckResponse):
# def GetHttp(**kwds):
# class Request(object):
# class Response(collections.namedtuple(
#     'HttpResponse', ['info', 'content', 'request_url'])):


import unittest2
from apitools.base.py import http_wrapper
"""Tests for http_wrapper."""




class RaisesExceptionOnLen(object):
  """Supports length property but raises if __len__ is used."""

  def __len__(self):
    raise Exception('len() called unnecessarily')

  def length(self):
    return 1


class HttpWrapperTest(unittest2.TestCase):

  def testRequestBodyUsesLengthProperty(self):

# Path: apitools/base/py/http_wrapper.py
# RESUME_INCOMPLETE = 308
# TOO_MANY_REQUESTS = 429
# _REDIRECT_STATUS_CODES = (
#     http_client.MOVED_PERMANENTLY,
#     http_client.FOUND,
#     http_client.SEE_OTHER,
#     http_client.TEMPORARY_REDIRECT,
#     RESUME_INCOMPLETE,
# )
# def _Httplib2Debuglevel(http_request, level, http=None):
#   def __init__(self, url='', http_method='GET', headers=None, body=''):
#   def loggable_body(self):
#   def loggable_body(self, value):
#   def body(self):
#   def body(self, value):
#   def __len__(self):
#   def length(self):
#     def ProcessContentRange(content_range):
#   def status_code(self):
#   def retry_after(self):
#   def is_redirect(self):
# def CheckResponse(response):
# def RebuildHttpConnections(http):
# def RethrowExceptionHandler(*unused_args):
# def HandleExceptionsAndRebuildHttpConnections(retry_args):
# def MakeRequest(http, http_request, retries=7, redirections=5,
#                 retry_func=HandleExceptionsAndRebuildHttpConnections,
#                 check_response_func=CheckResponse):
# def _MakeRequestNoRetry(http, http_request, redirections=5,
#                         check_response_func=CheckResponse):
# def GetHttp(**kwds):
# class Request(object):
# class Response(collections.namedtuple(
#     'HttpResponse', ['info', 'content', 'request_url'])):


# Path: apitools/base/py/http_wrapper_test.py
import unittest2
from apitools.base.py import http_wrapper

"""Tests for http_wrapper."""




class RaisesExceptionOnLen(object):
  """Supports length property but raises if __len__ is used."""

  def __len__(self):
    raise Exception('len() called unnecessarily')

  def length(self):
    return 1


class HttpWrapperTest(unittest2.TestCase):

  def testRequestBodyUsesLengthProperty(self):

    http_wrapper.Request(body=RaisesExceptionOnLen())