Revision: 3026
Author: jprantan
Date: Fri Apr 16 04:55:04 2010
Log: more tests
http://code.google.com/p/robotframework/source/detail?r=3026

Modified:
 /trunk/utest/utils/test_unic.py

=======================================
--- /trunk/utest/utils/test_unic.py     Fri Feb 26 02:15:16 2010
+++ /trunk/utest/utils/test_unic.py     Fri Apr 16 04:55:04 2010
@@ -7,9 +7,9 @@
     import UnicodeJavaLibrary


-class TestUnic(unittest.TestCase):
-
-    if is_jython:
+if is_jython:
+    class TestUnic(unittest.TestCase):
+
         def test_with_java_object(self):
             data = u'This is unicode \xe4\xf6'
             assert_equals(unic(JavaObject(data)), data)
@@ -27,5 +27,25 @@
             assert_true('Circle is 360' in iterator.next())


+class TestUnic(unittest.TestCase):
+
+    def test_object_containing_unicode_repr(self):
+        assert_equals(unic(UnicodeRepr()), u'Hyv\xe4')
+
+    def test_list_with_objects_containing_unicode_repr(self):
+        objects = [UnicodeRepr(), UnicodeRepr()]
+        if is_jython:
+ expected = '[Hyv\\xe4, Hyv\\xe4]' # This is actually wrong behavior
+        else:
+            expected = "<unrepresentable object 'list'>"
+        assert_equals(unic(objects), expected)
+
+
+class UnicodeRepr:
+
+    def __repr__(self):
+        return u'Hyv\xe4'
+
+
 if __name__ == '__main__':
     unittest.main()


--
Subscription settings: 
http://groups.google.com/group/robotframework-commit/subscribe?hl=en

Reply via email to