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
e87343e1
Commit
e87343e1
authored
Sep 25, 2005
by
Stefan H. Holek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Functional doctests now also set the cookie headers.
parent
1da7e7dd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
1 deletion
+35
-1
lib/python/Testing/ZopeTestCase/doc/CHANGES.txt
lib/python/Testing/ZopeTestCase/doc/CHANGES.txt
+1
-0
lib/python/Testing/ZopeTestCase/zopedoctest/FunctionalDocTest.txt
...on/Testing/ZopeTestCase/zopedoctest/FunctionalDocTest.txt
+24
-0
lib/python/Testing/ZopeTestCase/zopedoctest/functional.py
lib/python/Testing/ZopeTestCase/zopedoctest/functional.py
+1
-0
lib/python/Testing/ZopeTestCase/zopedoctest/testFunctionalDocTest.py
...Testing/ZopeTestCase/zopedoctest/testFunctionalDocTest.py
+9
-1
No files found.
lib/python/Testing/ZopeTestCase/doc/CHANGES.txt
View file @
e87343e1
...
@@ -4,6 +4,7 @@ Unreleased
...
@@ -4,6 +4,7 @@ Unreleased
than GET or HEAD while omitting the stdin argument.
than GET or HEAD while omitting the stdin argument.
- installProduct() now becomes a noop if ZopeTestCase did not apply its
- installProduct() now becomes a noop if ZopeTestCase did not apply its
patches.
patches.
- Made the functional doc tests set the cookie related headers.
0.9.8 (Zope 2.8 edition)
0.9.8 (Zope 2.8 edition)
- Renamed 'doctest' package to 'zopedoctest' because of name-shadowing
- Renamed 'doctest' package to 'zopedoctest' because of name-shadowing
...
...
lib/python/Testing/ZopeTestCase/zopedoctest/FunctionalDocTest.txt
View file @
e87343e1
...
@@ -155,3 +155,27 @@ Test passing in non-base64-encoded login/pass
...
@@ -155,3 +155,27 @@ Test passing in non-base64-encoded login/pass
>>> self.folder.index_html.title_or_id()
>>> self.folder.index_html.title_or_id()
'Baz'
'Baz'
Test setting cookies
>>> print http(r"""
... GET /test_folder_1_/index_html/set_cookie HTTP/1.1
... """, handle_errors=False)
HTTP/1.1 200 OK
Content-Length: 0
...
Set-Cookie: cookie_test="OK"
<BLANKLINE>
Test reading cookies
>>> print http(r"""
... GET /test_folder_1_/index_html/show_cookies HTTP/1.1
... Cookie: foo=bar; baz="oki doki"
... """, handle_errors=False)
HTTP/1.1 200 OK
Content-Length: 23
Content-Type: text/plain
<BLANKLINE>
foo: bar
baz: oki doki
<BLANKLINE>
lib/python/Testing/ZopeTestCase/zopedoctest/functional.py
View file @
e87343e1
...
@@ -182,6 +182,7 @@ def http(request_string, handle_errors=True):
...
@@ -182,6 +182,7 @@ def http(request_string, handle_errors=True):
)
)
header_output.setResponseStatus(response.getStatus(), response.errmsg)
header_output.setResponseStatus(response.getStatus(), response.errmsg)
header_output.setResponseHeaders(response.headers)
header_output.setResponseHeaders(response.headers)
header_output.appendResponseHeaders(response._cookie_list())
# Restore previous security manager, which may have been changed
# Restore previous security manager, which may have been changed
# by calling the publish method above
# by calling the publish method above
...
...
lib/python/Testing/ZopeTestCase/zopedoctest/testFunctionalDocTest.py
View file @
e87343e1
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
##############################################################################
##############################################################################
"""Example functional doctest
"""Example functional doctest
$Id
: testFunctionalDocTest.py,v 1.2 2005/03/26 18:07:08 shh42 Exp
$
$Id$
"""
"""
import
os
,
sys
import
os
,
sys
...
@@ -47,6 +47,14 @@ def setUp(self):
...
@@ -47,6 +47,14 @@ def setUp(self):
change_title
=
'''<dtml-call "manage_changeProperties(title=REQUEST.get('title'))">'''
change_title
=
'''<dtml-call "manage_changeProperties(title=REQUEST.get('title'))">'''
self
.
folder
.
addDTMLMethod
(
'change_title'
,
file
=
change_title
)
self
.
folder
.
addDTMLMethod
(
'change_title'
,
file
=
change_title
)
set_cookie
=
'''<dtml-call "REQUEST.RESPONSE.setCookie('cookie_test', 'OK')">'''
self
.
folder
.
addDTMLMethod
(
'set_cookie'
,
file
=
set_cookie
)
show_cookies
=
'''<dtml-in "REQUEST.cookies.keys()">
<dtml-var sequence-item>: <dtml-var "REQUEST.cookies[_['sequence-item']]">
</dtml-in>'''
self
.
folder
.
addDTMLMethod
(
'show_cookies'
,
file
=
show_cookies
)
def
test_suite
():
def
test_suite
():
return
TestSuite
((
return
TestSuite
((
...
...
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