diff test_pymonkey.py @ 104:00c1351b3e82

Added support for unicode property names in context.define_property().
author Atul Varma <varmaa@toolness.com>
date Sat, 15 Aug 2009 22:48:13 -0700
parents e4f7cc6beafe
children
line wrap: on
line diff
--- a/test_pymonkey.py	Sat Aug 15 17:38:03 2009 -0700
+++ b/test_pymonkey.py	Sat Aug 15 22:48:13 2009 -0700
@@ -318,6 +318,17 @@
         self.assertEqual(self._evalJsWrappedPyFunc(hai2u, 'hai2u()'),
                          2147483647)
 
+    def testDefinePropertyWorksWithUnicodePropertyNames(self):
+        cx = pymonkey.Runtime().new_context()
+        obj = cx.new_object()
+        cx.init_standard_classes(obj)
+        foo = cx.new_object()
+        cx.define_property(obj, u"foo\u2026", foo)
+        self.assertEqual(
+            cx.get_property(obj, u"foo\u2026"),
+            foo
+            )
+
     def testDefinePropertyWorksWithObject(self):
         cx = pymonkey.Runtime().new_context()
         obj = cx.new_object()