Commit 6fbaee13 authored by Michael Howitz's avatar Michael Howitz

Fix indentation and add actual IPv4 tests from master.

parent 338f6d07
......@@ -163,39 +163,48 @@ class VHMPort(unittest.TestCase):
transaction.abort()
self.app._p_jar.close()
def testIPv4(self):
ob = self.traverse('/VirtualHostBase/http/www.mysite.com:80'
'/folder/')
def testHostname(self):
self.traverse('/VirtualHostBase/http/www.mysite.com:80/folder/')
self.assertEqual(self.app.REQUEST['ACTUAL_URL'],
'http://www.mysite.com/folder/')
def testIPv4Noport(self):
ob = self.traverse('/VirtualHostBase/http/www.mysite.com'
'/folder/')
def testHostnameNoport(self):
self.traverse('/VirtualHostBase/http/www.mysite.com/folder/')
self.assertEqual(self.app.REQUEST['ACTUAL_URL'],
'http://www.mysite.com/folder/')
def testPassedPortIPv4(self):
ob = self.traverse('/VirtualHostBase/http/www.mysite.com:81'
'/folder/')
def testPassedPortHostname(self):
self.traverse('/VirtualHostBase/http/www.mysite.com:81/folder/')
self.assertEqual(self.app.REQUEST['ACTUAL_URL'],
'http://www.mysite.com:81/folder/')
def testIPv4(self):
self.traverse('/VirtualHostBase/http/127.0.0.1:80/folder/')
self.assertEqual(self.app.REQUEST['ACTUAL_URL'],
'http://127.0.0.1/folder/')
def testIPv4Noport(self):
self.traverse('/VirtualHostBase/http/127.0.0.1/folder/')
self.assertEqual(self.app.REQUEST['ACTUAL_URL'],
'http://127.0.0.1/folder/')
def testPassedPortIPv4(self):
self.traverse('/VirtualHostBase/http/127.0.0.1:81/folder/')
self.assertEqual(self.app.REQUEST['ACTUAL_URL'],
'http://127.0.0.1:81/folder/')
def testIPv6(self):
ob = self.traverse('/VirtualHostBase/http/[::1]:80'
'/folder/')
self.traverse('/VirtualHostBase/http/[::1]:80/folder/')
self.assertEqual(self.app.REQUEST['ACTUAL_URL'],
'http://[::1]/folder/')
def testIPv6NoPort(self):
ob = self.traverse('/VirtualHostBase/http/[::1]'
'/folder/')
self.traverse('/VirtualHostBase/http/[::1]/folder/')
self.assertEqual(self.app.REQUEST['ACTUAL_URL'],
'http://[::1]/folder/')
def testIPv6PassedPort(self):
ob = self.traverse('/VirtualHostBase/http/[::1]:81'
'/folder/')
self.traverse('/VirtualHostBase/http/[::1]:81/folder/')
self.assertEqual(self.app.REQUEST['ACTUAL_URL'],
'http://[::1]:81/folder/')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment