[Zope3-checkins]
SVN: Zope3/branches/3.3/src/RestrictedPython/tests/testCompile.py
- added forgotten file
Christian Theune
ct at gocept.com
Mon Dec 11 12:36:31 EST 2006
Log message for revision 71529:
- added forgotten file
Changed:
A Zope3/branches/3.3/src/RestrictedPython/tests/testCompile.py
-=-
Added: Zope3/branches/3.3/src/RestrictedPython/tests/testCompile.py
===================================================================
--- Zope3/branches/3.3/src/RestrictedPython/tests/testCompile.py 2006-12-11 17:35:42 UTC (rev 71528)
+++ Zope3/branches/3.3/src/RestrictedPython/tests/testCompile.py 2006-12-11 17:36:30 UTC (rev 71529)
@@ -0,0 +1,36 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors. All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+#
+##############################################################################
+__version__ = '$Revision$'[11:-2]
+
+import unittest
+
+from RestrictedPython.RCompile import niceParse
+import compiler.ast
+
+class CompileTests(unittest.TestCase):
+
+ def testUnicodeSource(self):
+ # We support unicode sourcecode.
+ source = u"u'à väry nice säntänce with umlauts.'"
+
+ parsed = niceParse(source, "test.py", "exec")
+ self.failUnless(isinstance(parsed, compiler.ast.Module))
+ parsed = niceParse(source, "test.py", "single")
+ self.failUnless(isinstance(parsed, compiler.ast.Module))
+ parsed = niceParse(source, "test.py", "eval")
+ self.failUnless(isinstance(parsed, compiler.ast.Expression))
+
+
+def test_suite():
+ return unittest.makeSuite(CompileTests)
Property changes on: Zope3/branches/3.3/src/RestrictedPython/tests/testCompile.py
___________________________________________________________________
Name: svn:keywords
+ Id Rev Date
Name: svn:eol-style
+ native
More information about the Zope3-Checkins
mailing list