Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
fuchsia.googlesource.com-third_party-mako
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fuchsia-mirror
fuchsia.googlesource.com-third_party-mako
Commits
70dec0ae
Commit
70dec0ae
authored
13 years ago
by
Mike Bayer
Browse files
Options
Downloads
Patches
Plain Diff
py3k fixes
parent
1efbc032
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/test_exceptions.py
+8
-2
8 additions, 2 deletions
test/test_exceptions.py
test/test_template.py
+12
-4
12 additions, 4 deletions
test/test_template.py
with
20 additions
and
6 deletions
test/test_exceptions.py
+
8
−
2
View file @
70dec0ae
...
...
@@ -75,10 +75,16 @@ ${u'привет'}
template
.
render_unicode
()
except
exceptions
.
CompileException
,
ce
:
html_error
=
exceptions
.
html_error_template
().
render
()
assert
(
"
CompileException: Fragment 'if 2 == 2: /an
"
if
util
.
py3k
:
assert
(
"
CompileException: Fragment 'if 2 == 2: /an
"
"
error' is not a partial control statement
"
"
at line: 2 char: 1
"
)
in
\
"
at line: 2 char: 1
"
)
.
encode
(
sys
.
getdefaultencoding
(),
'
htmlentityreplace
'
)
in
\
html_error
else
:
assert
(
"
CompileException: Fragment 'if 2 == 2: /an
"
"
error' is not a partial control statement
"
"
at line: 2 char: 1
"
)
in
\
html_error
if
util
.
py3k
:
assert
u
"
3 ${'привет'}
"
.
encode
(
sys
.
getdefaultencoding
(),
...
...
This diff is collapsed.
Click to expand it.
test/test_template.py
+
12
−
4
View file @
70dec0ae
...
...
@@ -25,10 +25,18 @@ class EncodingTest(TemplateTest):
except
:
# <h3>Exception: <span style="color:red">Foobar</span></h3>
markup
=
html_error_template
().
render
(
full
=
False
,
css
=
False
)
print
markup
assert
'
<span style=
"
color:red
"
>Foobar</span></h3>
'
not
in
markup
assert
'
<span style="color:red">Foobar</span>
'
in
markup
if
util
.
py3k
:
assert
'
<span style=
"
color:red
"
>Foobar</span></h3>
'
\
.
encode
(
'
ascii
'
)
not
in
markup
assert
'
<span style="color:red"
'
\
'
>Foobar</span>
'
\
.
encode
(
'
ascii
'
)
in
markup
else
:
assert
'
<span style=
"
color:red
"
>Foobar</span></h3>
'
\
not
in
markup
assert
'
<span style="color:red"
'
\
'
>Foobar</span>
'
in
markup
def
test_unicode
(
self
):
self
.
_do_memory_test
(
u
"""
Alors vous imaginez ma surprise, au lever du jour, quand une drôle de petite voix m’a réveillé. Elle disait: « S’il vous plaît… dessine-moi un mouton! »
"""
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment