diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_map.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_map.py b/tests/test_map.py index 13c6cb1..bbf0a52 100644 --- a/tests/test_map.py +++ b/tests/test_map.py @@ -1,5 +1,6 @@ import collections.abc import gc +import pickle import random import unittest import weakref @@ -1148,6 +1149,15 @@ class BaseMapTest: self.assertEqual(dict(h.items()), d) self.assertEqual(len(h), len(d)) + def test_map_pickle(self): + h = self.Map(a=1, b=2) + for proto in range(pickle.HIGHEST_PROTOCOL): + p = pickle.dumps(h, proto) + uh = pickle.loads(p) + + self.assertTrue(isinstance(uh, self.Map)) + self.assertEqual(h, uh) + class PyMapTest(BaseMapTest, unittest.TestCase): |