summaryrefslogtreecommitdiff
path: root/cheetah/Tests
diff options
context:
space:
mode:
authorR. Tyler Ballance <tyler@monkeypox.org>2010-01-27 20:39:01 -0800
committerR. Tyler Ballance <tyler@monkeypox.org>2010-01-27 20:39:01 -0800
commit5d931545fcde3029a5e4f49d9d72533c0bd0f667 (patch)
tree38fe3bc8aa5d8defae00a343a39ce3e87899a5cf /cheetah/Tests
parent46df95cf55fc1d9b9bb2513d47e3e1c9aa401b21 (diff)
downloadpython-cheetah-5d931545fcde3029a5e4f49d9d72533c0bd0f667.tar.gz
Find the #encoding directive even if it's after a comment (for example)
Added a test and applied Juan's patch, everything seems to check out alright with it Reported-by: Juan Fiol <fiolj@yahoo.com>
Diffstat (limited to 'cheetah/Tests')
-rw-r--r--cheetah/Tests/SyntaxAndOutput.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/cheetah/Tests/SyntaxAndOutput.py b/cheetah/Tests/SyntaxAndOutput.py
index 4fc467c..e052e6e 100644
--- a/cheetah/Tests/SyntaxAndOutput.py
+++ b/cheetah/Tests/SyntaxAndOutput.py
@@ -742,6 +742,12 @@ class EncodingDirective(OutputTest):
self.verify("#encoding latin-1\nAndr\202",
u'Andr\202')
+ def test6(self):
+ '''Using #encoding on the second line'''
+ self.verify("""### Comments on the first line
+#encoding utf-8\n\xe1\x88\xb4""",
+ u'\u1234', outputEncoding='utf8')
+
class UnicodeDirective(OutputTest):
def test1(self):
"""basic #unicode """