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): ...@@ -163,39 +163,48 @@ class VHMPort(unittest.TestCase):
transaction.abort() transaction.abort()
self.app._p_jar.close() self.app._p_jar.close()
def testIPv4(self): def testHostname(self):
ob = self.traverse('/VirtualHostBase/http/www.mysite.com:80' self.traverse('/VirtualHostBase/http/www.mysite.com:80/folder/')
'/folder/')
self.assertEqual(self.app.REQUEST['ACTUAL_URL'], self.assertEqual(self.app.REQUEST['ACTUAL_URL'],
'http://www.mysite.com/folder/') 'http://www.mysite.com/folder/')
def testIPv4Noport(self): def testHostnameNoport(self):
ob = self.traverse('/VirtualHostBase/http/www.mysite.com' self.traverse('/VirtualHostBase/http/www.mysite.com/folder/')
'/folder/')
self.assertEqual(self.app.REQUEST['ACTUAL_URL'], self.assertEqual(self.app.REQUEST['ACTUAL_URL'],
'http://www.mysite.com/folder/') 'http://www.mysite.com/folder/')
def testPassedPortIPv4(self): def testPassedPortHostname(self):
ob = self.traverse('/VirtualHostBase/http/www.mysite.com:81' self.traverse('/VirtualHostBase/http/www.mysite.com:81/folder/')
'/folder/')
self.assertEqual(self.app.REQUEST['ACTUAL_URL'], self.assertEqual(self.app.REQUEST['ACTUAL_URL'],
'http://www.mysite.com:81/folder/') '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): def testIPv6(self):
ob = self.traverse('/VirtualHostBase/http/[::1]:80' self.traverse('/VirtualHostBase/http/[::1]:80/folder/')
'/folder/')
self.assertEqual(self.app.REQUEST['ACTUAL_URL'], self.assertEqual(self.app.REQUEST['ACTUAL_URL'],
'http://[::1]/folder/') 'http://[::1]/folder/')
def testIPv6NoPort(self): def testIPv6NoPort(self):
ob = self.traverse('/VirtualHostBase/http/[::1]' self.traverse('/VirtualHostBase/http/[::1]/folder/')
'/folder/')
self.assertEqual(self.app.REQUEST['ACTUAL_URL'], self.assertEqual(self.app.REQUEST['ACTUAL_URL'],
'http://[::1]/folder/') 'http://[::1]/folder/')
def testIPv6PassedPort(self): def testIPv6PassedPort(self):
ob = self.traverse('/VirtualHostBase/http/[::1]:81' self.traverse('/VirtualHostBase/http/[::1]:81/folder/')
'/folder/')
self.assertEqual(self.app.REQUEST['ACTUAL_URL'], self.assertEqual(self.app.REQUEST['ACTUAL_URL'],
'http://[::1]:81/folder/') '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