Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
9a018e35
Commit
9a018e35
authored
May 20, 2010
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Flesh out edge case tests.
parent
b0a489ac
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
2 deletions
+27
-2
src/Products/SiteAccess/tests/testVirtualHostMonster.py
src/Products/SiteAccess/tests/testVirtualHostMonster.py
+27
-2
No files found.
src/Products/SiteAccess/tests/testVirtualHostMonster.py
View file @
9a018e35
...
@@ -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'
],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment