# Path: restkit/contrib/wsgi_proxy.py
# ALLOWED_METHODS = ['GET', 'HEAD', 'POST', 'PUT', 'DELETE']
# BLOCK_SIZE = 4096 * 16
# WEBOB_ERROR = ("Content-Length is set to -1. This usually mean that WebOb has "
#         "already parsed the content body. You should set the Content-Length "
#         "header to the correct value before forwarding your request to the "
#         "proxy: ``req.content_length = str(len(req.body));`` "
#         "req.get_response(proxy)")
# class Proxy(object):
# class TransparentProxy(Proxy):
# class HostProxy(Proxy):
#     def __init__(self, manager=None, allowed_methods=ALLOWED_METHODS,
#             strip_script_name=True,  **kwargs):
#     def extract_uri(self, environ):
#     def __call__(self, environ, start_response):
#     def extract_uri(self, environ):
#     def __init__(self, uri, **kwargs):
#     def extract_uri(self, environ):
# def get_config(local_config):
# def make_proxy(global_config, **local_config):
# def make_host_proxy(global_config, uri=None, **local_config):


import t
from _server_test import HOST, PORT
from restkit.contrib import wsgi_proxy
        from webob import Request
    resp = req.get_response(proxy)
    body = resp.body
    assert 'path: /query' in body, str(resp)

@with_webob
def test_002(req):
    req.path_info = '/json'
    req.environ['CONTENT_TYPE'] = 'application/json'
    req.method = 'POST'
    req.body = 'test post'
    proxy = wsgi_proxy.Proxy(allowed_methods=['POST'])
    resp = req.get_response(proxy)
    body = resp.body
    assert resp.content_length == 9, str(resp)

    proxy = wsgi_proxy.Proxy(allowed_methods=['GET'])
    resp = req.get_response(proxy)
    assert resp.status.startswith('403'), resp.status

@with_webob
def test_003(req):
    req.path_info = '/json'
    req.environ['CONTENT_TYPE'] = 'application/json'
    req.method = 'PUT'
    req.body = 'test post'
    proxy = wsgi_proxy.Proxy(allowed_methods=['PUT'])
    resp = req.get_response(proxy)
    body = resp.body
    assert resp.content_length == 9, str(resp)


# Path: restkit/contrib/wsgi_proxy.py
# ALLOWED_METHODS = ['GET', 'HEAD', 'POST', 'PUT', 'DELETE']
# BLOCK_SIZE = 4096 * 16
# WEBOB_ERROR = ("Content-Length is set to -1. This usually mean that WebOb has "
#         "already parsed the content body. You should set the Content-Length "
#         "header to the correct value before forwarding your request to the "
#         "proxy: ``req.content_length = str(len(req.body));`` "
#         "req.get_response(proxy)")
# class Proxy(object):
# class TransparentProxy(Proxy):
# class HostProxy(Proxy):
#     def __init__(self, manager=None, allowed_methods=ALLOWED_METHODS,
#             strip_script_name=True,  **kwargs):
#     def extract_uri(self, environ):
#     def __call__(self, environ, start_response):
#     def extract_uri(self, environ):
#     def __init__(self, uri, **kwargs):
#     def extract_uri(self, environ):
# def get_config(local_config):
# def make_proxy(global_config, **local_config):
# def make_host_proxy(global_config, uri=None, **local_config):


# Path: tests/010-test-proxies.py
import t
from _server_test import HOST, PORT
from restkit.contrib import wsgi_proxy
        from webob import Request

    resp = req.get_response(proxy)
    body = resp.body
    assert 'path: /query' in body, str(resp)

@with_webob
def test_002(req):
    req.path_info = '/json'
    req.environ['CONTENT_TYPE'] = 'application/json'
    req.method = 'POST'
    req.body = 'test post'
    proxy = wsgi_proxy.Proxy(allowed_methods=['POST'])
    resp = req.get_response(proxy)
    body = resp.body
    assert resp.content_length == 9, str(resp)

    proxy = wsgi_proxy.Proxy(allowed_methods=['GET'])
    resp = req.get_response(proxy)
    assert resp.status.startswith('403'), resp.status

@with_webob
def test_003(req):
    req.path_info = '/json'
    req.environ['CONTENT_TYPE'] = 'application/json'
    req.method = 'PUT'
    req.body = 'test post'
    proxy = wsgi_proxy.Proxy(allowed_methods=['PUT'])
    resp = req.get_response(proxy)
    body = resp.body
    assert resp.content_length == 9, str(resp)


    proxy = wsgi_proxy.Proxy(allowed_methods=['GET'])