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
a6fe70ad
Commit
a6fe70ad
authored
Dec 11, 2003
by
Evan Simpson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix VHM tests and make them pass
parent
5493778f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
11 deletions
+15
-11
lib/python/OFS/Application.py
lib/python/OFS/Application.py
+3
-3
lib/python/Products/SiteAccess/tests/testVirtualHostMonster.py
...ython/Products/SiteAccess/tests/testVirtualHostMonster.py
+10
-6
lib/python/ZPublisher/HTTPRequest.py
lib/python/ZPublisher/HTTPRequest.py
+2
-2
No files found.
lib/python/OFS/Application.py
View file @
a6fe70ad
...
@@ -12,8 +12,8 @@
...
@@ -12,8 +12,8 @@
##############################################################################
##############################################################################
__doc__
=
'''Application support
__doc__
=
'''Application support
$Id: Application.py,v 1.19
7 2003/12/10 17:52:46
evan Exp $'''
$Id: Application.py,v 1.19
8 2003/12/11 19:50:27
evan Exp $'''
__version__
=
'$Revision: 1.19
7
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.19
8
$'
[
11
:
-
2
]
import
Globals
,
Folder
,
os
,
sys
,
App
.
Product
,
App
.
ProductRegistry
,
misc_
import
Globals
,
Folder
,
os
,
sys
,
App
.
Product
,
App
.
ProductRegistry
,
misc_
import
time
,
traceback
,
os
,
Products
import
time
,
traceback
,
os
,
Products
...
@@ -148,7 +148,7 @@ class Application(Globals.ApplicationDefaultPermissions,
...
@@ -148,7 +148,7 @@ class Application(Globals.ApplicationDefaultPermissions,
def
absolute_url_path
(
self
):
def
absolute_url_path
(
self
):
'''The absolute URL path of the root object is BASEPATH1 or "/".'''
'''The absolute URL path of the root object is BASEPATH1 or "/".'''
try
:
try
:
return
self
.
REQUEST
[
'BASEPATH1'
]
return
self
.
REQUEST
[
'BASEPATH1'
]
or
'/'
except
(
AttributeError
,
KeyError
):
except
(
AttributeError
,
KeyError
):
return
'/'
return
'/'
...
...
lib/python/Products/SiteAccess/tests/testVirtualHostMonster.py
View file @
a6fe70ad
...
@@ -7,7 +7,7 @@ Also see http://zope.org/Collectors/Zope/809
...
@@ -7,7 +7,7 @@ Also see http://zope.org/Collectors/Zope/809
Note: Tests require Zope >= 2.7
Note: Tests require Zope >= 2.7
$Id: testVirtualHostMonster.py,v 1.
2 2003/12/10 17:52:4
7 evan Exp $
$Id: testVirtualHostMonster.py,v 1.
3 2003/12/11 19:50:2
7 evan Exp $
"""
"""
from
Testing.makerequest
import
makerequest
from
Testing.makerequest
import
makerequest
...
@@ -73,17 +73,21 @@ def gen_cases():
...
@@ -73,17 +73,21 @@ def gen_cases():
yield
'/'
.
join
(
vparts
),
vr
,
_vh
,
p
,
ubase
yield
'/'
.
join
(
vparts
),
vr
,
_vh
,
p
,
ubase
for
i
,
(
vaddr
,
vr
,
_vh
,
p
,
ubase
)
in
enumerate
(
gen_cases
()):
for
i
,
(
vaddr
,
vr
,
_vh
,
p
,
ubase
)
in
enumerate
(
gen_cases
()):
def
test
(
self
):
def
test
(
self
,
vaddr
=
vaddr
,
vr
=
vr
,
_vh
=
_vh
,
p
=
p
,
ubase
=
ubase
):
ob
=
self
.
traverse
(
'%s/%s/'
%
(
vaddr
,
p
))
ob
=
self
.
traverse
(
'%s/%s/'
%
(
vaddr
,
p
))
vhp
=
'/'
+
'/'
.
join
([
x
for
x
in
_vh
,
p
if
x
])
sl_vh
=
(
_vh
and
(
'/'
+
_vh
))
self
.
assertEqual
(
ob
.
absolute_url
(),
ubase
+
vhp
)
aup
=
sl_vh
+
(
p
and
(
'/'
+
p
))
self
.
assertEqual
(
ob
.
absolute_url_path
(),
vhp
)
self
.
assertEqual
(
ob
.
absolute_url_path
(),
aup
)
self
.
assertEqual
(
self
.
app
.
REQUEST
[
'BASEPATH1'
]
+
'/'
+
p
,
aup
)
self
.
assertEqual
(
ob
.
absolute_url
(),
ubase
+
aup
)
self
.
assertEqual
(
ob
.
absolute_url
(
relative
=
1
),
p
)
self
.
assertEqual
(
ob
.
absolute_url
(
relative
=
1
),
p
)
self
.
assertEqual
(
ob
.
virtual_url_path
(),
p
)
self
.
assertEqual
(
ob
.
virtual_url_path
(),
p
)
self
.
assertEqual
(
ob
.
getPhysicalPath
(),
(
''
,
'folder'
,
'doc'
))
self
.
assertEqual
(
ob
.
getPhysicalPath
(),
(
''
,
'folder'
,
'doc'
))
app
=
ob
.
aq_parent
.
aq_parent
app
=
ob
.
aq_parent
.
aq_parent
self
.
assertEqual
(
app
.
absolute_url
(),
ubase
+
'/'
+
_vh
)
# The absolute URL doesn't end with a slash
self
.
assertEqual
(
app
.
absolute_url
(),
ubase
+
sl_vh
)
# The absolute URL path always begins with a slash
self
.
assertEqual
(
app
.
absolute_url_path
(),
'/'
+
_vh
)
self
.
assertEqual
(
app
.
absolute_url_path
(),
'/'
+
_vh
)
self
.
assertEqual
(
app
.
absolute_url
(
relative
=
1
),
''
)
self
.
assertEqual
(
app
.
absolute_url
(
relative
=
1
),
''
)
self
.
assertEqual
(
app
.
virtual_url_path
(),
''
)
self
.
assertEqual
(
app
.
virtual_url_path
(),
''
)
...
...
lib/python/ZPublisher/HTTPRequest.py
View file @
a6fe70ad
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
#
#
##############################################################################
##############################################################################
__version__
=
'$Revision: 1.9
4
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.9
5
$'
[
11
:
-
2
]
import
re
,
sys
,
os
,
urllib
,
time
,
random
,
cgi
,
codecs
import
re
,
sys
,
os
,
urllib
,
time
,
random
,
cgi
,
codecs
from
types
import
StringType
,
UnicodeType
from
types
import
StringType
,
UnicodeType
...
@@ -1149,7 +1149,7 @@ class HTTPRequest(BaseRequest):
...
@@ -1149,7 +1149,7 @@ class HTTPRequest(BaseRequest):
v
.
insert
(
0
,
''
)
v
.
insert
(
0
,
''
)
else
:
else
:
v
.
insert
(
0
,
other
[
'SERVER_URL'
])
v
.
insert
(
0
,
other
[
'SERVER_URL'
])
URL
=
'/'
.
join
(
v
)
or
'/'
URL
=
'/'
.
join
(
v
)
if
other
.
has_key
(
'PUBLISHED'
):
if
other
.
has_key
(
'PUBLISHED'
):
# Don't cache URLs until publishing traversal is done.
# Don't cache URLs until publishing traversal is done.
other
[
key
]
=
URL
other
[
key
]
=
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