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
7f52d51d
Commit
7f52d51d
authored
Jul 29, 2006
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more tests for csv-table directive
parent
a4bbbad2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
lib/python/Products/ZReST/tests/test_ZReST.py
lib/python/Products/ZReST/tests/test_ZReST.py
+29
-0
No files found.
lib/python/Products/ZReST/tests/test_ZReST.py
View file @
7f52d51d
...
...
@@ -5,6 +5,7 @@
$Id$
"""
import
unittest
import
tempfile
txt
=
"""Hello World
============
...
...
@@ -20,6 +21,11 @@ Von V
"""
csv_text
=
"""bin:x:1:1:bin:/bin:/bin/bash
daemon:x:2:2:Daemon:/sbin:/bin/bash
"""
class
TestZReST
(
unittest
.
TestCase
):
def
_getTargetClass
(
self
):
...
...
@@ -29,6 +35,11 @@ class TestZReST(unittest.TestCase):
def
_makeOne
(
self
,
id
=
'test'
,
*
args
,
**
kw
):
return
self
.
_getTargetClass
()(
id
=
id
,
*
args
,
**
kw
)
def
_csvfile
(
self
):
fn
=
tempfile
.
mktemp
()
open
(
fn
,
'w'
).
write
(
csv_text
)
return
fn
def
test_empty
(
self
):
empty
=
self
.
_makeOne
()
...
...
@@ -91,6 +102,24 @@ class TestZReST(unittest.TestCase):
self
.
assertRaises
(
NotImplementedError
,
resty
.
render
)
def
test_csv_table_file_option_raise
(
self
):
resty
=
self
.
_makeOne
()
csv_file
=
self
.
_csvfile
()
resty
.
source
=
'.. csv-table::
\
n
:file: %s'
%
csv_file
result
=
resty
.
render
()
self
.
failUnless
(
'daemon'
not
in
result
,
'csv-table/file directive is not disabled!'
)
def
test_csv_table_url_option_raise
(
self
):
resty
=
self
.
_makeOne
()
csv_file
=
self
.
_csvfile
()
resty
.
source
=
'.. csv-table::
\
n
:url: file://%s'
%
csv_file
result
=
resty
.
render
()
self
.
failUnless
(
'daemon'
not
in
result
,
'csv-table/url directive is not disabled!'
)
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
TestZReST
))
...
...
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