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
6fbaee13
Commit
6fbaee13
authored
Nov 09, 2018
by
Michael Howitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix indentation and add actual IPv4 tests from master.
parent
338f6d07
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
22 deletions
+31
-22
src/Products/SiteAccess/tests/testVirtualHostMonster.py
src/Products/SiteAccess/tests/testVirtualHostMonster.py
+31
-22
No files found.
src/Products/SiteAccess/tests/testVirtualHostMonster.py
View file @
6fbaee13
...
...
@@ -97,7 +97,7 @@ class VHMRegressions(unittest.TestCase):
ob
=
self
.
traverse
(
'/VirtualHostBase/http/www.mysite.com:80'
'/folder/VirtualHostRoot'
)
self
.
assertEqual
(
self
.
app
.
REQUEST
[
'ACTUAL_URL'
],
'http://www.mysite.com/'
)
'http://www.mysite.com/'
)
def
gen_cases
():
for
vbase
,
ubase
in
(
...
...
@@ -163,41 +163,50 @@ class VHMPort(unittest.TestCase):
transaction
.
abort
()
self
.
app
.
_p_jar
.
close
()
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
testHostnameNoport
(
self
):
self
.
traverse
(
'/VirtualHostBase/http/www.mysite.com/folder/'
)
self
.
assertEqual
(
self
.
app
.
REQUEST
[
'ACTUAL_URL'
],
'http://www.mysite.com/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
):
ob
=
self
.
traverse
(
'/VirtualHostBase/http/www.mysite.com:80'
'/folder/'
)
self
.
assertEqual
(
self
.
app
.
REQUEST
[
'ACTUAL_URL'
],
'http://www.mysite.com/folder/'
)
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
):
ob
=
self
.
traverse
(
'/VirtualHostBase/http/www.mysite.com'
'/folder/'
)
self
.
assertEqual
(
self
.
app
.
REQUEST
[
'ACTUAL_URL'
],
'http://www.mysite.com/folder/'
)
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
):
ob
=
self
.
traverse
(
'/VirtualHostBase/http/www.mysite.com:81'
'/folder/'
)
self
.
assertEqual
(
self
.
app
.
REQUEST
[
'ACTUAL_URL'
],
'http://www.mysite.com:81/folder/'
)
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/'
)
'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/'
)
'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/'
)
'http://[::1]:81/folder/'
)
class
VHMAddingTests
(
unittest
.
TestCase
):
...
...
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