[Python-modules-commits] r25577 - in packages/cerealizer/trunk/debian/patches (2 files)

bernat at users.alioth.debian.org bernat at users.alioth.debian.org
Thu Aug 15 12:40:43 UTC 2013


    Date: Thursday, August 15, 2013 @ 12:40:41
  Author: bernat
Revision: 25577

Patch tests to make them work with Python3

Added:
  packages/cerealizer/trunk/debian/patches/python3-compatible-tests.patch
Modified:
  packages/cerealizer/trunk/debian/patches/series

Added: packages/cerealizer/trunk/debian/patches/python3-compatible-tests.patch
===================================================================
--- packages/cerealizer/trunk/debian/patches/python3-compatible-tests.patch	                        (rev 0)
+++ packages/cerealizer/trunk/debian/patches/python3-compatible-tests.patch	2013-08-15 12:40:41 UTC (rev 25577)
@@ -0,0 +1,40 @@
+Index: Cerealizer-0.7/test/regtest.py
+===================================================================
+--- Cerealizer-0.7.orig/test/regtest.py	2006-06-17 00:05:55.000000000 +0200
++++ Cerealizer-0.7/test/regtest.py	2013-08-15 14:39:59.750049950 +0200
+@@ -10,7 +10,7 @@
+ 
+ import cerealizer
+ import unittest
+-
++import imp
+ 
+ class TestBasicType(unittest.TestCase):
+   def setUp(self):
+@@ -43,7 +43,7 @@
+   def test_set2     (self): self.loads_dumps_and_compare(set([1, 2.2, "jiba"]))
+   def test_dict1    (self): self.loads_dumps_and_compare({})
+   def test_dict2    (self): self.loads_dumps_and_compare({ "jiba" : 100, "other" : 0 })
+-  def test_dict3    (self): self.loads_dumps_and_compare({ "jiba" : range(100), "other" : { 1:2 } })
++  def test_dict3    (self): self.loads_dumps_and_compare({ "jiba" : list(range(100)), "other" : { 1:2 } })
+   
+   def test_None    (self): self.loads_dumps_and_compare(None)
+   
+@@ -228,7 +228,7 @@
+     o = OldObj()
+     s = cerealizer.dumps(o)
+     
+-    reload(cerealizer)
++    imp.reload(cerealizer)
+     class NewObj(object):
+       def __init__(self):
+         self.x    = 2
+@@ -283,7 +283,7 @@
+     
+   def test_craked_file1(self):
+     craked_file = "cereal1\n2\n__builtin__.dict\nfile\n0\nr0\nr1\n"
+-    self.assertRaises(StandardError, lambda : cerealizer.loads(craked_file))
++    self.assertRaises(Exception, lambda : cerealizer.loads(craked_file))
+     
+ 
+ if __name__ == '__main__': unittest.main()

Modified: packages/cerealizer/trunk/debian/patches/series
===================================================================
--- packages/cerealizer/trunk/debian/patches/series	2013-08-15 12:21:24 UTC (rev 25576)
+++ packages/cerealizer/trunk/debian/patches/series	2013-08-15 12:40:41 UTC (rev 25577)
@@ -1 +1,2 @@
 no_bytecompilation.patch
+python3-compatible-tests.patch




More information about the Python-modules-commits mailing list