summaryrefslogtreecommitdiffstats
path: root/tests/test_enum.py
diff options
context:
space:
mode:
authorPaul Pogonyshev <pogonyshev@gmx.net>2008-04-02 20:18:03 +0000
committerPaul Pogonyshev <paulp@src.gnome.org>2008-04-02 20:18:03 +0000
commit8282c9960218a9cd20db5146cf924460701949f8 (patch)
tree67edbb423ebf860d19db2e7d16881c0a4265ca58 /tests/test_enum.py
parentf84de31b695944a29ec058a5b965242fbf15d051 (diff)
downloadpygobject-8282c9960218a9cd20db5146cf924460701949f8.tar.gz
pygobject-8282c9960218a9cd20db5146cf924460701949f8.tar.xz
pygobject-8282c9960218a9cd20db5146cf924460701949f8.zip
bug #428732 (pyg_enum_new): Fix two wrong assertions about
2008-04-02 Paul Pogonyshev <pogonyshev@gmx.net> * gobject/pygenum.c: bug #428732 (pyg_enum_new): Fix two wrong assertions about '__enum_values__' size and contents. (pyg_enum_reduce): New function (based on patch by Phil Dumont). (pyg_enum_methods): Hook it up. svn path=/trunk/; revision=756
Diffstat (limited to 'tests/test_enum.py')
-rw-r--r--tests/test_enum.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_enum.py b/tests/test_enum.py
index 6543cec..41d72a2 100644
--- a/tests/test_enum.py
+++ b/tests/test_enum.py
@@ -1,3 +1,4 @@
+import pickle
import unittest
import warnings
@@ -96,6 +97,14 @@ class EnumTest(unittest.TestCase):
self.failUnless(isinstance(default, gtk.WindowType))
self.assertEqual(default, gtk.WINDOW_TOPLEVEL)
+ def testPickling(self):
+ values = [getattr(gtk, name) for name in dir(gtk)
+ if isinstance(getattr(gtk, name), gobject.GEnum)]
+ for protocol in range(0, pickle.HIGHEST_PROTOCOL + 1):
+ for value in values:
+ self.assertEqual(value, pickle.loads(pickle.dumps(value, protocol)))
+
+
class FlagsTest(unittest.TestCase):
def testFlags(self):
self.failUnless(issubclass(GFlags, int))