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
aaf3ff7c
Commit
aaf3ff7c
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
4ba64d54
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 @
aaf3ff7c
...
...
@@ -4,6 +4,7 @@ Unreleased
than GET or HEAD while omitting the stdin argument.
- installProduct() now becomes a noop if ZopeTestCase did not apply its
patches.
- Made the functional doc tests set the cookie related headers.
0.9.8 (Zope 2.8 edition)
- Renamed 'doctest' package to 'zopedoctest' because of name-shadowing
...
...
lib/python/Testing/ZopeTestCase/zopedoctest/FunctionalDocTest.txt
View file @
aaf3ff7c
...
...
@@ -155,3 +155,27 @@ Test passing in non-base64-encoded login/pass
>>> self.folder.index_html.title_or_id()
'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 @
aaf3ff7c
...
...
@@ -181,6 +181,7 @@ def http(request_string, handle_errors=True):
)
header_output.setResponseStatus(response.getStatus(), response.errmsg)
header_output.setResponseHeaders(response.headers)
header_output.appendResponseHeaders(response._cookie_list())
# Restore previous security manager, which may have been changed
# by calling the publish method above
...
...
lib/python/Testing/ZopeTestCase/zopedoctest/testFunctionalDocTest.py
View file @
aaf3ff7c
...
...
@@ -12,7 +12,7 @@
##############################################################################
"""Example functional doctest
$Id
: testFunctionalDocTest.py,v 1.2 2005/03/26 18:07:08 shh42 Exp
$
$Id$
"""
import
os
,
sys
...
...
@@ -47,6 +47,14 @@ def setUp(self):
change_title
=
'''<dtml-call "manage_changeProperties(title=REQUEST.get('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
():
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