summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorianb <devnull@localhost>2008-11-16 00:33:22 +0000
committerianb <devnull@localhost>2008-11-16 00:33:22 +0000
commit2747956188bc28956c0db5701f5f0ea0019b50bf (patch)
treec2d81f5d6aa34af6345f4795a120fc03db1e3e75
parent3390876a00f7143ae77f4b941a13ef5b7235a817 (diff)
downloadpaste-2747956188bc28956c0db5701f5f0ea0019b50bf.tar.gz
update test for new website content
-rw-r--r--paste/urlparser.py22
-rw-r--r--paste/util/quoting.py2
-rw-r--r--tests/test_proxy.py2
3 files changed, 14 insertions, 12 deletions
diff --git a/paste/urlparser.py b/paste/urlparser.py
index 8712639..519ddcf 100644
--- a/paste/urlparser.py
+++ b/paste/urlparser.py
@@ -430,20 +430,22 @@ class StaticURLParser(object):
def __init__(self, directory, root_directory=None,
cache_max_age=None):
- if os.path.sep != '/':
- directory = directory.replace(os.path.sep, '/')
- self.directory = os.path.normcase(os.path.abspath(directory))
+ self.directory = self.normpath(directory)
self.root_directory = root_directory
if root_directory is not None:
- self.root_directory = os.path.normpath(self.root_directory)
+ self.root_directory = self.normpath(self.root_directory)
else:
- self.root_directory = directory
- self.root_directory = os.path.normcase(os.path.normpath(
- os.path.abspath(self.root_directory)))
+ self.root_directory = self.directory
self.cache_max_age = cache_max_age
- if os.path.sep != '/':
- directory = directory.replace('/', os.path.sep)
- self.root_directory = self.root_directory.replace('/', os.path.sep)
+
+ def normpath(path):
+ path = os.path.normcase(
+ os.path.normpath(
+ os.path.abspath(path)))
+ if os.path.sep != '/':
+ path = path.replace(os.path.sep, '/')
+ return path
+ normpath = staticmethod(normpath)
def __call__(self, environ, start_response):
path_info = environ.get('PATH_INFO', '')
diff --git a/paste/util/quoting.py b/paste/util/quoting.py
index 9b67596..cd87f2d 100644
--- a/paste/util/quoting.py
+++ b/paste/util/quoting.py
@@ -50,7 +50,7 @@ def html_unquote(s, encoding=None):
>>> html_unquote('&lt;hey&nbsp;you&gt;')
u'<hey\xa0you>'
>>> html_unquote('')
- u''
+ ''
>>> html_unquote('&blahblah;')
u'&blahblah;'
>>> html_unquote('\xe1\x80\xa9')
diff --git a/tests/test_proxy.py b/tests/test_proxy.py
index 7cf808d..36d16b5 100644
--- a/tests/test_proxy.py
+++ b/tests/test_proxy.py
@@ -8,5 +8,5 @@ def test_paste_website():
app = proxy.Proxy('http://pythonpaste.org')
app = TestApp(app)
res = app.get('/')
- assert 'Documentation' in res
+ assert 'documentation' in res