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
42c157b9
Commit
42c157b9
authored
Apr 09, 2001
by
Evan Simpson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests to match new TAL default of omitting attribute languages
parent
51d88f6d
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
110 additions
and
91 deletions
+110
-91
lib/python/Products/PageTemplates/tests/framework.py
lib/python/Products/PageTemplates/tests/framework.py
+21
-9
lib/python/Products/PageTemplates/tests/output/CheckNotExpression.html
...oducts/PageTemplates/tests/output/CheckNotExpression.html
+4
-4
lib/python/Products/PageTemplates/tests/output/CheckNothing.html
...hon/Products/PageTemplates/tests/output/CheckNothing.html
+1
-1
lib/python/Products/PageTemplates/tests/output/CheckPathNothing.html
...Products/PageTemplates/tests/output/CheckPathNothing.html
+1
-1
lib/python/Products/PageTemplates/tests/output/CheckWithXMLHeader.html
...oducts/PageTemplates/tests/output/CheckWithXMLHeader.html
+1
-1
lib/python/Products/PageTemplates/tests/output/DTML1a.html
lib/python/Products/PageTemplates/tests/output/DTML1a.html
+8
-8
lib/python/Products/PageTemplates/tests/output/DTML1b.html
lib/python/Products/PageTemplates/tests/output/DTML1b.html
+2
-2
lib/python/Products/PageTemplates/tests/output/DTML3.html
lib/python/Products/PageTemplates/tests/output/DTML3.html
+7
-7
lib/python/Products/PageTemplates/tests/output/GlobalsShadowLocals.html
...ducts/PageTemplates/tests/output/GlobalsShadowLocals.html
+6
-6
lib/python/Products/PageTemplates/tests/output/Loop1.html
lib/python/Products/PageTemplates/tests/output/Loop1.html
+6
-12
lib/python/Products/PageTemplates/tests/output/StringExpression.html
...Products/PageTemplates/tests/output/StringExpression.html
+1
-1
lib/python/Products/PageTemplates/tests/output/TeeShop1.html
lib/python/Products/PageTemplates/tests/output/TeeShop1.html
+6
-8
lib/python/Products/PageTemplates/tests/output/TeeShop2.html
lib/python/Products/PageTemplates/tests/output/TeeShop2.html
+2
-2
lib/python/Products/PageTemplates/tests/output/TeeShopLAF.html
...ython/Products/PageTemplates/tests/output/TeeShopLAF.html
+2
-2
lib/python/Products/PageTemplates/tests/run.py
lib/python/Products/PageTemplates/tests/run.py
+15
-0
lib/python/Products/PageTemplates/tests/testDTMLTests.py
lib/python/Products/PageTemplates/tests/testDTMLTests.py
+5
-5
lib/python/Products/PageTemplates/tests/testHTMLTests.py
lib/python/Products/PageTemplates/tests/testHTMLTests.py
+22
-22
No files found.
lib/python/Products/PageTemplates/tests/framework.py
View file @
42c157b9
...
...
@@ -98,12 +98,13 @@
import
string
if
sys
.
modules
.
has_key
(
'unittest'
):
# The framework should already be set up
pass
else
:
scriptdir
=
sys
.
path
[
0
]
if
scriptdir
==
''
:
scriptdir
=
sys
.
path
[
0
]
input_dir
=
os
.
path
.
join
(
scriptdir
,
'input'
)
output_dir
=
os
.
path
.
join
(
scriptdir
,
'output'
)
if
not
sys
.
modules
.
has_key
(
'unittest'
):
if
os
.
path
.
abspath
(
scriptdir
)
==
os
.
path
.
abspath
(
'.'
):
# We're in the tests directory, and need to find unittest.
cwd
=
os
.
getcwd
()
while
1
:
for
ext
in
'py'
,
'pyc'
,
'pyo'
,
'pyd'
:
...
...
@@ -116,16 +117,27 @@ else:
break
sys
.
path
.
insert
(
1
,
cwd
)
else
:
# We must be in the same directory as unittest
sys
.
path
.
insert
(
1
,
''
)
import
unittest
import
unittest
TestRunner
=
unittest
.
TextTestRunner
def
read_input
(
filename
):
filename
=
os
.
path
.
join
(
input_dir
,
filename
)
return
open
(
filename
,
'r'
).
read
()
def
read_output
(
filename
):
filename
=
os
.
path
.
join
(
output_dir
,
filename
)
return
open
(
filename
,
'r'
).
read
()
def
main
():
if
len
(
sys
.
argv
)
>
1
:
globals
()[
sys
.
argv
[
1
]]()
errs
=
globals
()[
sys
.
argv
[
1
]]()
else
:
TestRunner
().
run
(
test_suite
())
errs
=
TestRunner
().
run
(
test_suite
())
sys
.
exit
(
errs
and
1
or
0
)
def
debug
():
test_suite
().
debug
()
...
...
lib/python/Products/PageTemplates/tests/output/CheckNotExpression.html
View file @
42c157b9
<html>
<head></head>
<body>
<div
tal:content=
"not:python:0"
>
1
</div>
<div
tal:content=
"not:python:1"
>
0
</div>
<div
tal:content=
"not: python:1"
>
0
</div>
<div
tal:content=
"not:python:range(1,20)"
>
0
</div>
<div>
1
</div>
<div>
0
</div>
<div>
0
</div>
<div>
0
</div>
</body>
</html>
lib/python/Products/PageTemplates/tests/output/CheckNothing.html
View file @
42c157b9
<html>
<body>
<head>
<title
tal:content=
"nothing"
></title>
<title></title>
</head>
</body>
</html>
lib/python/Products/PageTemplates/tests/output/CheckPathNothing.html
View file @
42c157b9
<html>
<body>
<head>
<title
tal:content=
"path:nothing"
></title>
<title></title>
</head>
</body>
</html>
lib/python/Products/PageTemplates/tests/output/CheckWithXMLHeader.html
View file @
42c157b9
<?xml version="1.0" ?>
<html>
<body
tal:content=
"string:Hello!"
>
Hello!
</body>
<body>
Hello!
</body>
</html>
lib/python/Products/PageTemplates/tests/output/DTML1a.html
View file @
42c157b9
<html
xmlns:tal=
"http://xml.zope.org/namespaces/tal"
>
<html>
<head><title>
Test of documentation templates
</title></head>
<body>
<dl
tal:condition=
"here/args"
>
<dl>
<dt>
The arguments to this test program were:
</dt>
<dd>
<ul>
<li
tal:repeat=
"arg here/args"
>
<li>
Argument number 1
is one
</li><li
tal:repeat=
"arg here/args"
>
</li><li>
Argument number 2
is two
</li><li
tal:repeat=
"arg here/args"
>
</li><li>
Argument number 3
is three
</li><li
tal:repeat=
"arg here/args"
>
</li><li>
Argument number 4
is cha
</li><li
tal:repeat=
"arg here/args"
>
</li><li>
Argument number 5
is cha
</li><li
tal:repeat=
"arg here/args"
>
</li><li>
Argument number 6
is cha
</li>
...
...
lib/python/Products/PageTemplates/tests/output/DTML1b.html
View file @
42c157b9
<html
xmlns:tal=
"http://xml.zope.org/namespaces/tal"
>
<html>
<head><title>
Test of documentation templates
</title></head>
<body>
<p
tal:condition=
"not:here/args"
>
No arguments were given.
</p>
<p>
No arguments were given.
</p>
And thats da trooth.
</body>
</html>
lib/python/Products/PageTemplates/tests/output/DTML3.html
View file @
42c157b9
<head><title>
Test of documentation templates
</title></head>
<body>
<div
tal:condition=
"here/args"
>
<div>
The arguments were:
<dl>
<span
tal:repeat=
"arg options/batch"
>
<span>
<dt>
one.
</dt>
<dd>
Argument 1 was one
</dd>
</span><span
tal:repeat=
"arg options/batch"
>
</span><span>
<dt>
two.
</dt>
<dd>
Argument 2 was two
</dd>
</span><span
tal:repeat=
"arg options/batch"
>
</span><span>
<dt>
three.
</dt>
<dd>
Argument 3 was three
</dd>
</span><span
tal:repeat=
"arg options/batch"
>
</span><span>
<dt>
four.
</dt>
<dd>
Argument 4 was four
</dd>
</span><span
tal:repeat=
"arg options/batch"
>
</span><span>
<dt>
five.
</dt>
<dd>
Argument 5 was five
</dd>
</span>
</dl>
<span
tal:condition=
"options/batch/next_sequence"
>
<span>
(six-ten)
</span>
</div>
...
...
lib/python/Products/PageTemplates/tests/output/GlobalsShadowLocals.html
View file @
42c157b9
<html
tal:define=
"global x python:1"
>
<html>
<head></head>
<body>
<div
tal:define=
"x python:2"
>
<span
tal:content=
"x"
>
2
</span>
<div>
<span>
2
</span>
</div>
<div>
<span
tal:content=
"x"
>
1
</span>
<span>
1
</span>
</div>
<div
tal:define=
"global x python:3"
>
<span
tal:content=
"x"
>
3
</span>
<div>
<span>
3
</span>
</div>
</body>
</html>
lib/python/Products/PageTemplates/tests/output/Loop1.html
View file @
42c157b9
...
...
@@ -5,20 +5,14 @@
<body>
<p>
Choose your type:
</p>
<ul>
<li
tal:repeat=
"type python:'digital', 'analog', 'organic'"
>
<a
href=
"/mach/digital"
tal:attributes=
"href string:/mach/$type"
tal:content=
"type"
>
digital
</a>
<li>
<a
href=
"/mach/digital"
>
digital
</a>
</li>
<li
tal:repeat=
"type python:'digital', 'analog', 'organic'"
>
<a
href=
"/mach/analog"
tal:attributes=
"href string:/mach/$type"
tal:content=
"type"
>
analog
</a>
<li>
<a
href=
"/mach/analog"
>
analog
</a>
</li>
<li
tal:repeat=
"type python:'digital', 'analog', 'organic'"
>
<a
href=
"/mach/organic"
tal:attributes=
"href string:/mach/$type"
tal:content=
"type"
>
organic
</a>
<li>
<a
href=
"/mach/organic"
>
organic
</a>
</li>
</ul>
</body>
...
...
lib/python/Products/PageTemplates/tests/output/StringExpression.html
View file @
42c157b9
<html>
<body>
<head>
<title
tal:content=
"string:Hello World!"
>
Hello World!
</title>
<title>
Hello World!
</title>
</head>
</body>
</html>
lib/python/Products/PageTemplates/tests/output/TeeShop1.html
View file @
42c157b9
<html
metal:use-macro=
"container/laf/macros/page"
>
<html>
<head>
<title>
Zope Stuff
</title>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=iso-8859-1"
>
...
...
@@ -28,7 +28,7 @@
</table>
<br>
<br>
<div
metal:fill-slot=
"body"
>
<div>
<table
width=
"500"
border=
"0"
cellspacing=
"0"
cellpadding=
"0"
align=
"center"
>
<tr>
<td
bgcolor=
"#0000CC"
>
...
...
@@ -36,7 +36,7 @@
<tr
bgcolor=
"#FFFFFF"
align=
"center"
>
<td><img
src=
"/images/welcome.gif"
width=
"293"
height=
"28"
></td>
</tr>
<tr
bgcolor=
"#FFFFFF"
align=
"center"
valign=
"top"
tal:repeat=
"product options/getProducts"
>
<tr
bgcolor=
"#FFFFFF"
align=
"center"
valign=
"top"
>
<td>
<table
width=
"100%"
border=
"0"
cellspacing=
"0"
cellpadding=
"6"
>
<tr>
...
...
@@ -44,8 +44,7 @@
</b>
This is the tee for those who LOVE Zope. Show your heart on your tee.
</td>
<td
align=
"right"
width=
"1%"
rowspan=
"2"
>
<p><img
src=
"/images/smlatee.jpg"
width=
"200"
height=
"200"
tal:attributes=
"src string:/images/${product/image}"
></p>
width=
"200"
height=
"200"
></p>
</td>
</tr>
<tr>
...
...
@@ -55,7 +54,7 @@
</table>
</td>
</tr>
<tr
bgcolor=
"#FFFFFF"
align=
"center"
valign=
"top"
tal:repeat=
"product options/getProducts"
>
<tr
bgcolor=
"#FFFFFF"
align=
"center"
valign=
"top"
>
<td>
<table
width=
"100%"
border=
"0"
cellspacing=
"0"
cellpadding=
"6"
>
<tr>
...
...
@@ -63,8 +62,7 @@
</b>
This is the tee for Jim Fulton. He's the Zope Pope!
</td>
<td
align=
"right"
width=
"1%"
rowspan=
"2"
>
<p><img
src=
"/images/smpztee.jpg"
width=
"200"
height=
"200"
tal:attributes=
"src string:/images/${product/image}"
></p>
width=
"200"
height=
"200"
></p>
</td>
</tr>
<tr>
...
...
lib/python/Products/PageTemplates/tests/output/TeeShop2.html
View file @
42c157b9
<html
metal:use-macro=
"container/laf/macros/page"
>
<html>
<head>
<title>
Zope Stuff
</title>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=iso-8859-1"
>
...
...
@@ -28,7 +28,7 @@
</table>
<br>
<br>
<div
metal:fill-slot=
"body"
>
<div>
Body
</div>
<br><br>
...
...
lib/python/Products/PageTemplates/tests/output/TeeShopLAF.html
View file @
42c157b9
<html
metal:define-macro=
"page"
>
<html>
<head>
<title>
Zope Stuff
</title>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=iso-8859-1"
>
...
...
@@ -28,7 +28,7 @@
</table>
<br>
<br>
<div
metal:define-slot=
"body"
>
<div>
<table
width=
"500"
border=
"0"
cellspacing=
"0"
cellpadding=
"0"
align=
"center"
>
<tr>
<td
bgcolor=
"#0000CC"
>
...
...
lib/python/Products/PageTemplates/tests/run.py
0 → 100755
View file @
42c157b9
#! /usr/bin/env python1.5
"""Run all tests."""
import
os
,
sys
execfile
(
os
.
path
.
join
(
sys
.
path
[
0
],
'framework.py'
))
def
test_suite
():
suite
=
unittest
.
TestSuite
()
for
mname
in
(
'DTMLTests'
,
'HTMLTests'
,
'Expressions'
,
'TALES'
):
m
=
__import__
(
'test'
+
mname
)
suite
.
addTest
(
m
.
test_suite
())
return
suite
if
__name__
==
"__main__"
:
main
()
lib/python/Products/PageTemplates/tests/testDTMLTests.py
View file @
42c157b9
...
...
@@ -120,18 +120,18 @@ class DTMLTests(unittest.TestCase):
</body></html>
"""
tal
=
open
(
'input/DTML1.html'
).
read
(
)
tal
=
read_input
(
'DTML1.html'
)
self
.
t
.
write
(
tal
)
aa
=
util
.
argv
((
'one'
,
'two'
,
'three'
,
'cha'
,
'cha'
,
'cha'
))
o
=
self
.
t
.
__of__
(
aa
)()
expect
=
open
(
'output/DTML1a.html'
).
read
(
)
expect
=
read_output
(
'DTML1a.html'
)
util
.
check_xml
(
expect
,
o
)
aa
=
util
.
argv
(())
o
=
self
.
t
.
__of__
(
aa
)()
expect
=
open
(
'output/DTML1b.html'
).
read
(
)
expect
=
read_output
(
'DTML1b.html'
)
util
.
check_xml
(
expect
,
o
)
def
check3
(
self
):
...
...
@@ -164,7 +164,7 @@ class DTMLTests(unittest.TestCase):
</body></html>
"""
tal
=
open
(
'input/DTML3.html'
).
read
(
)
tal
=
read_input
(
'DTML3.html'
)
self
.
t
.
write
(
tal
)
aa
=
util
.
argv
((
'one'
,
'two'
,
'three'
,
'four'
,
'five'
,
...
...
@@ -175,7 +175,7 @@ class DTMLTests(unittest.TestCase):
import
batch
o
=
self
.
t
.
__of__
(
aa
)(
batch
=
batch
.
batch
(
aa
.
args
,
5
))
expect
=
open
(
'output/DTML3.html'
).
read
(
)
expect
=
read_output
(
'DTML3.html'
)
util
.
check_xml
(
expect
,
o
)
def
test_suite
():
...
...
lib/python/Products/PageTemplates/tests/testHTMLTests.py
View file @
42c157b9
...
...
@@ -117,75 +117,75 @@ class HTMLTests(unittest.TestCase):
def
check1
(
self
):
laf
=
self
.
folder
.
laf
laf
.
write
(
open
(
'input/TeeShopLAF.html'
).
read
(
))
expect
=
open
(
'output/TeeShopLAF.html'
).
read
(
)
laf
.
write
(
read_input
(
'TeeShopLAF.html'
))
expect
=
read_output
(
'TeeShopLAF.html'
)
util
.
check_html
(
expect
,
laf
())
def
check2
(
self
):
self
.
folder
.
laf
.
write
(
open
(
'input/TeeShopLAF.html'
).
read
(
))
self
.
folder
.
laf
.
write
(
read_input
(
'TeeShopLAF.html'
))
t
=
self
.
folder
.
t
t
.
write
(
open
(
'input/TeeShop2.html'
).
read
(
))
expect
=
open
(
'output/TeeShop2.html'
).
read
(
)
t
.
write
(
read_input
(
'TeeShop2.html'
))
expect
=
read_output
(
'TeeShop2.html'
)
out
=
t
(
getProducts
=
self
.
getProducts
)
util
.
check_html
(
expect
,
out
)
def
check3
(
self
):
self
.
folder
.
laf
.
write
(
open
(
'input/TeeShopLAF.html'
).
read
(
))
self
.
folder
.
laf
.
write
(
read_input
(
'TeeShopLAF.html'
))
t
=
self
.
folder
.
t
t
.
write
(
open
(
'input/TeeShop1.html'
).
read
(
))
expect
=
open
(
'output/TeeShop1.html'
).
read
(
)
t
.
write
(
read_input
(
'TeeShop1.html'
))
expect
=
read_output
(
'TeeShop1.html'
)
out
=
t
(
getProducts
=
self
.
getProducts
)
util
.
check_html
(
expect
,
out
)
def
checkSimpleLoop
(
self
):
t
=
self
.
folder
.
t
t
.
write
(
open
(
'input/Loop1.html'
).
read
(
))
expect
=
open
(
'output/Loop1.html'
).
read
(
)
t
.
write
(
read_input
(
'Loop1.html'
))
expect
=
read_output
(
'Loop1.html'
)
out
=
t
()
util
.
check_html
(
expect
,
out
)
def
checkGlobalsShadowLocals
(
self
):
t
=
self
.
folder
.
t
t
.
write
(
open
(
'input/GlobalsShadowLocals.html'
).
read
(
))
expect
=
open
(
'output/GlobalsShadowLocals.html'
).
read
(
)
t
.
write
(
read_input
(
'GlobalsShadowLocals.html'
))
expect
=
read_output
(
'GlobalsShadowLocals.html'
)
out
=
t
()
util
.
check_html
(
expect
,
out
)
def
checkStringExpressions
(
self
):
t
=
self
.
folder
.
t
t
.
write
(
open
(
'input/StringExpression.html'
).
read
(
))
expect
=
open
(
'output/StringExpression.html'
).
read
(
)
t
.
write
(
read_input
(
'StringExpression.html'
))
expect
=
read_output
(
'StringExpression.html'
)
out
=
t
()
util
.
check_html
(
expect
,
out
)
def
checkReplaceWithNothing
(
self
):
t
=
self
.
folder
.
t
t
.
write
(
open
(
'input/CheckNothing.html'
).
read
(
))
expect
=
open
(
'output/CheckNothing.html'
).
read
(
)
t
.
write
(
read_input
(
'CheckNothing.html'
))
expect
=
read_output
(
'CheckNothing.html'
)
out
=
t
()
util
.
check_html
(
expect
,
out
)
def
checkWithXMLHeader
(
self
):
t
=
self
.
folder
.
t
t
.
write
(
open
(
'input/CheckWithXMLHeader.html'
).
read
(
))
expect
=
open
(
'output/CheckWithXMLHeader.html'
).
read
(
)
t
.
write
(
read_input
(
'CheckWithXMLHeader.html'
))
expect
=
read_output
(
'CheckWithXMLHeader.html'
)
out
=
t
()
util
.
check_html
(
expect
,
out
)
def
checkNotExpression
(
self
):
t
=
self
.
folder
.
t
t
.
write
(
open
(
'input/CheckNotExpression.html'
).
read
(
))
expect
=
open
(
'output/CheckNotExpression.html'
).
read
(
)
t
.
write
(
read_input
(
'CheckNotExpression.html'
))
expect
=
read_output
(
'CheckNotExpression.html'
)
out
=
t
()
util
.
check_html
(
expect
,
out
)
def
checkPathNothing
(
self
):
t
=
self
.
folder
.
t
t
.
write
(
open
(
'input/CheckPathNothing.html'
).
read
(
))
expect
=
open
(
'output/CheckPathNothing.html'
).
read
(
)
t
.
write
(
read_input
(
'CheckPathNothing.html'
))
expect
=
read_output
(
'CheckPathNothing.html'
)
out
=
t
()
util
.
check_html
(
expect
,
out
)
...
...
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