[pygobject] tests: test genum __reduce__ implementation
- From: Christoph Reiter <creiter src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] tests: test genum __reduce__ implementation
- Date: Tue, 20 Mar 2018 00:00:23 +0000 (UTC)
commit fac77fd317d280ec13851eec04e52e1e56d860d7
Author: Christoph Reiter <reiter christoph gmail com>
Date: Mon Mar 19 23:34:16 2018 +0100
tests: test genum __reduce__ implementation
tests/test_gi.py | 7 +++++++
1 file changed, 7 insertions(+)
---
diff --git a/tests/test_gi.py b/tests/test_gi.py
index 8b355ebd..91f4ffc7 100644
--- a/tests/test_gi.py
+++ b/tests/test_gi.py
@@ -13,6 +13,7 @@ import os
import gc
import weakref
import warnings
+import pickle
import gi
import gi.overrides
@@ -1844,6 +1845,12 @@ class TestGEnum(unittest.TestCase):
self.assertTrue(isinstance(GIMarshallingTests.GEnum.VALUE3, GIMarshallingTests.GEnum))
self.assertEqual(42, GIMarshallingTests.GEnum.VALUE3)
+ def test_pickle(self):
+ v = GIMarshallingTests.GEnum.VALUE3
+ new_v = pickle.loads(pickle.dumps(v))
+ assert new_v == v
+ assert isinstance(new_v, GIMarshallingTests.GEnum)
+
def test_value_nick_and_name(self):
self.assertEqual(GIMarshallingTests.GEnum.VALUE1.value_nick, 'value1')
self.assertEqual(GIMarshallingTests.GEnum.VALUE2.value_nick, 'value2')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]