#1 Merged
Repository
domruf domruf
Branch
default
Repository
ianb ianb
Branch
default

fix issue #3

Author
  1. Dominik Ruf avatarDominik Ruf
Reviewers
Description

this fixes issue #3

Comments (3)

    1. Dominik Ruf author

      well, a simple test would be this

      Test string_keys parameter
      
          >>> from wsgiproxy.app import WSGIProxyApp
          >>> from webob import Request
      
          >>> app = WSGIProxyApp("http://example.com/", string_keys=['REMOTE_USER'])
          >>> req = Request.blank('http://example.com/test')
          >>> req.environ['REMOTE_USER'] = 'testuser'
          >>> req.environ['REMOTE_ADDR'] = '1.2.3.4'
          
          >>> res = req.get_response(app)
      

      But I'm not really sure where to put it since there are not tests for WSGIProxyApp.

      1. Marc Abramowitz

        How about this?

        diff -r aae189d7887d wsgiproxy/app.py
        --- a/wsgiproxy/app.py  Tue Mar 12 13:53:02 2013 -0700
        +++ b/wsgiproxy/app.py  Tue Mar 12 14:28:42 2013 -0700
        @@ -43,6 +43,20 @@
             def __init__(self, href, secret_file=None,
                          string_keys=None, unicode_keys=None,
                          json_keys=None, pickle_keys=None):
        +        """
        +        Test string_keys parameter
        +
        +        >>> from wsgiproxy.app import WSGIProxyApp
        +        >>> from webob import Request
        +
        +        >>> app = WSGIProxyApp("http://example.com/", string_keys=['REMOTE_USER'])
        +        >>> req = Request.blank('http://example.com/test')
        +        >>> req.environ['REMOTE_USER'] = 'testuser'
        +        >>> req.environ['REMOTE_ADDR'] = '1.2.3.4'
        +
        +        >>> res = req.get_response(app)
        +        """
        +
                 self.href = href
                 self.secret_file = secret_file
                 self.string_keys = string_keys or ()
        
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.