Commit 9a018e35 authored by Tres Seaver's avatar Tres Seaver

Flesh out edge case tests.

parent b0a489ac
...@@ -51,24 +51,49 @@ class VHMRegressions(unittest.TestCase): ...@@ -51,24 +51,49 @@ class VHMRegressions(unittest.TestCase):
m = self.app.folder.doc.getPhysicalPath m = self.app.folder.doc.getPhysicalPath
self.assertEqual(m(), ('', 'folder', 'doc')) self.assertEqual(m(), ('', 'folder', 'doc'))
def test_actual_url(self): def test_actual_url_no_VHR_no_doc_w_trailing_slash(self):
self.app.folder.manage_addDTMLMethod('index_html', '') ob = self.traverse('/VirtualHostBase/http/www.mysite.com:80'
'/folder/')
self.assertEqual(self.app.REQUEST['ACTUAL_URL'],
'http://www.mysite.com/folder/')
def test_actual_url_no_VHR_no_doc_no_trailing_slash(self):
ob = self.traverse('/VirtualHostBase/http/www.mysite.com:80'
'/folder')
self.assertEqual(self.app.REQUEST['ACTUAL_URL'],
'http://www.mysite.com/folder')
def test_actual_url_no_VHR_w_doc_w_trailing_slash(self):
ob = self.traverse('/VirtualHostBase/http/www.mysite.com:80'
'/folder/doc/')
self.assertEqual(self.app.REQUEST['ACTUAL_URL'],
'http://www.mysite.com/folder/doc/')
def test_actual_url_no_VHR_w_doc_no_trailing_slash(self):
ob = self.traverse('/VirtualHostBase/http/www.mysite.com:80'
'/folder/doc')
self.assertEqual(self.app.REQUEST['ACTUAL_URL'],
'http://www.mysite.com/folder/doc')
def test_actual_url_w_VHR_w_doc_w_trailing_slash(self):
ob = self.traverse('/VirtualHostBase/http/www.mysite.com:80' ob = self.traverse('/VirtualHostBase/http/www.mysite.com:80'
'/folder/VirtualHostRoot/doc/') '/folder/VirtualHostRoot/doc/')
self.assertEqual(self.app.REQUEST['ACTUAL_URL'], self.assertEqual(self.app.REQUEST['ACTUAL_URL'],
'http://www.mysite.com/doc/') 'http://www.mysite.com/doc/')
def test_actual_url_w_VHR_w_doc_no_trailing_slash(self):
ob = self.traverse('/VirtualHostBase/http/www.mysite.com:80' ob = self.traverse('/VirtualHostBase/http/www.mysite.com:80'
'/folder/VirtualHostRoot/doc') '/folder/VirtualHostRoot/doc')
self.assertEqual(self.app.REQUEST['ACTUAL_URL'], self.assertEqual(self.app.REQUEST['ACTUAL_URL'],
'http://www.mysite.com/doc') 'http://www.mysite.com/doc')
def test_actual_url_w_VHR_no_doc_w_trailing_slash(self):
ob = self.traverse('/VirtualHostBase/http/www.mysite.com:80' ob = self.traverse('/VirtualHostBase/http/www.mysite.com:80'
'/folder/VirtualHostRoot/') '/folder/VirtualHostRoot/')
self.assertEqual(self.app.REQUEST['ACTUAL_URL'], self.assertEqual(self.app.REQUEST['ACTUAL_URL'],
'http://www.mysite.com/') 'http://www.mysite.com/')
def test_actual_url_w_VHR_w_doc_no_trailing_slash(self):
ob = self.traverse('/VirtualHostBase/http/www.mysite.com:80' ob = self.traverse('/VirtualHostBase/http/www.mysite.com:80'
'/folder/VirtualHostRoot') '/folder/VirtualHostRoot')
self.assertEqual(self.app.REQUEST['ACTUAL_URL'], self.assertEqual(self.app.REQUEST['ACTUAL_URL'],
......
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