mirror of
https://github.com/python/cpython.git
synced 2025-07-14 06:45:17 +00:00

svn+ssh://pythondev@svn.python.org/python/trunk ........ r60876 | georg.brandl | 2008-02-17 16:14:10 +0100 (Sun, 17 Feb 2008) | 2 lines Fix function name. ........ r60877 | facundo.batista | 2008-02-17 17:21:13 +0100 (Sun, 17 Feb 2008) | 4 lines Now we handle different the backup copy, because of security issues regarding user/group and permissions. Fixes 1050828. ........ r60878 | facundo.batista | 2008-02-17 19:59:29 +0100 (Sun, 17 Feb 2008) | 4 lines Issue 2112. mmap does not raises EnvironmentError no more, but a subclass of it. Thanks John Lenton. ........ r60882 | amaury.forgeotdarc | 2008-02-17 21:56:31 +0100 (Sun, 17 Feb 2008) | 5 lines Compilation was broken on Windows since the introduction of Advanced String Formatting. Only PCBuild (vs9) was really tested. Changes for older compilers were done manually. ........ r60883 | georg.brandl | 2008-02-17 22:18:55 +0100 (Sun, 17 Feb 2008) | 2 lines #2133: fix HTML color spec. ........ r60884 | facundo.batista | 2008-02-18 04:43:43 +0100 (Mon, 18 Feb 2008) | 5 lines Issue #1916. Added isgenerator() and isgeneratorfunction() to inspect.py. Thanks Javi Mansilla for patch review and corrections. ........ r60885 | facundo.batista | 2008-02-18 13:48:43 +0100 (Mon, 18 Feb 2008) | 4 lines Issue 1224. Now we support again the double slash in the URL. Thanks Anthony Lenton. ........ r60887 | eric.smith | 2008-02-18 15:25:02 +0100 (Mon, 18 Feb 2008) | 1 line Temporarily removed float tests. See issue 1600. ........ r60891 | kristjan.jonsson | 2008-02-18 18:40:47 +0100 (Mon, 18 Feb 2008) | 1 line Perform correct handling of stack overflow for windows: Catch the correct exception code and reset the overflow condition when handled. ........
41 lines
1.3 KiB
Python
41 lines
1.3 KiB
Python
"""
|
|
These tests only check url parsing for now.
|
|
We don't want to require the 'network' resource.
|
|
"""
|
|
|
|
import os, unittest
|
|
from SimpleHTTPServer import SimpleHTTPRequestHandler
|
|
from test import test_support
|
|
|
|
|
|
class SocketlessRequestHandler (SimpleHTTPRequestHandler):
|
|
def __init__(self):
|
|
pass
|
|
|
|
class SimpleHTTPRequestHandlerTestCase(unittest.TestCase):
|
|
""" Test url parsing """
|
|
def setUp (self):
|
|
self.translated = os.getcwd()
|
|
self.translated = os.path.join(self.translated, 'filename')
|
|
self.handler = SocketlessRequestHandler ()
|
|
|
|
def test_queryArguments (self):
|
|
path = self.handler.translate_path ('/filename')
|
|
self.assertEquals (path, self.translated)
|
|
path = self.handler.translate_path ('/filename?foo=bar')
|
|
self.assertEquals (path, self.translated)
|
|
path = self.handler.translate_path ('/filename?a=b&spam=eggs#zot')
|
|
self.assertEquals (path, self.translated)
|
|
|
|
def test_startWithDoubleSlash (self):
|
|
path = self.handler.translate_path ('//filename')
|
|
self.assertEquals (path, self.translated)
|
|
path = self.handler.translate_path ('//filename?foo=bar')
|
|
self.assertEquals (path, self.translated)
|
|
|
|
|
|
def test_main():
|
|
test_support.run_unittest(SimpleHTTPRequestHandlerTestCase)
|
|
|
|
if __name__ == "__main__":
|
|
test_main()
|