summaryrefslogtreecommitdiff
path: root/src/isodate/tests/test_pickle.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/isodate/tests/test_pickle.py')
-rw-r--r--src/isodate/tests/test_pickle.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/isodate/tests/test_pickle.py b/src/isodate/tests/test_pickle.py
index b52f8cb..7fc6213 100644
--- a/src/isodate/tests/test_pickle.py
+++ b/src/isodate/tests/test_pickle.py
@@ -1,5 +1,7 @@
import unittest
-import cPickle as pickle
+
+from six.moves import cPickle as pickle
+
import isodate
@@ -31,11 +33,17 @@ class TestPickle(unittest.TestCase):
pikl = pickle.dumps(dur, proto)
if dur != pickle.loads(pikl):
raise Exception("not equal")
- except Exception, e:
+ except Exception as e:
failed.append("pickle proto %d failed (%s)" % (proto, repr(e)))
self.assertEqual(len(failed), 0, "pickle protos failed: %s" %
str(failed))
+ def test_pickle_utc(self):
+ '''
+ isodate.UTC objects remain the same after pickling.
+ '''
+ self.assertTrue(isodate.UTC is pickle.loads(pickle.dumps(isodate.UTC)))
+
def test_suite():
'''
@@ -50,5 +58,6 @@ def test_suite():
def load_tests(loader, tests, pattern):
return test_suite()
+
if __name__ == '__main__':
unittest.main(defaultTest='test_suite')