Commits

Olemis Lang committed a49c3d0

Trac RPC [ refs #11050 ] : Only test (invalid XML) Unicode code points not greater than sys.maxunicode

  • Participants
  • Parent commits 14258ce
  • Branches t11050

Comments (0)

Files changed (1)

File t11050/t11050_r13710_xml_invalid_chars.diff

 
 diff -r a61fdef74307 trunk/tracrpc/tests/xml_rpc.py
 --- a/trunk/tracrpc/tests/xml_rpc.py	Thu Mar 06 13:44:39 2014 -0500
-+++ b/trunk/tracrpc/tests/xml_rpc.py	Thu Mar 06 16:48:02 2014 -0500
-@@ -5,6 +5,7 @@
++++ b/trunk/tracrpc/tests/xml_rpc.py	Thu Mar 06 18:07:36 2014 -0500
+@@ -5,6 +5,8 @@
  (c) 2009      ::: www.CodeResort.com - BV Network AS (simon-code@bvnetwork.no)
  """
  
 +import os
++import sys
  import unittest
  
  import xmlrpclib
-@@ -108,6 +109,44 @@
+@@ -108,6 +110,46 @@
          self.assertEquals('Desc & ription', ticket[3]['description'])
          self.admin.ticket.delete(tid1)
  
 +                             (0xFFFFE, 0xFFFFF), (0x10FFFE, 0x10FFFF) ]
 +
 +        for low, high in _illegal_unichrs:
-+            for x in (low, (low + high) / 2, high):
-+                self.assertEquals(u'\uFFFD', self.user.test_unichr.unichr(x),
-+                                  "Failed unichr with %d" % (x,))
++            if low < sys.maxunicode:
++                for x in (low, (low + high) / 2, high):
++                    self.assertEquals(u'\uFFFD', 
++                                      self.user.test_unichr.unichr(x),
++                                      "Failed unichr with %d" % (x,))
 +
 +        # Remove plugin and restart
 +        os.unlink(plugin)
  
 diff -r a61fdef74307 trunk/tracrpc/util.py
 --- a/trunk/tracrpc/util.py	Thu Mar 06 13:44:39 2014 -0500
-+++ b/trunk/tracrpc/util.py	Thu Mar 06 16:48:02 2014 -0500
++++ b/trunk/tracrpc/util.py	Thu Mar 06 18:07:36 2014 -0500
 @@ -64,3 +64,6 @@
      from trac.util.datefmt import to_timestamp
      to_utimestamp = to_timestamp
 +
 diff -r a61fdef74307 trunk/tracrpc/xml_rpc.py
 --- a/trunk/tracrpc/xml_rpc.py	Thu Mar 06 13:44:39 2014 -0500
-+++ b/trunk/tracrpc/xml_rpc.py	Thu Mar 06 16:48:02 2014 -0500
++++ b/trunk/tracrpc/xml_rpc.py	Thu Mar 06 18:07:36 2014 -0500
 @@ -7,6 +7,8 @@
  """