summaryrefslogtreecommitdiffstats
path: root/tests/test_pickle.py
diff options
context:
space:
mode:
authorGuillaume Horel <guillaume.horel@serenitascapital.com>2016-11-03 14:59:12 -0400
committerGuillaume Horel <guillaume.horel@serenitascapital.com>2016-11-03 14:59:41 -0400
commita65eaf7a6d72508bc5368a6adbfe415ca3967f13 (patch)
tree07ff8328238d72936ec514f09c870efaabc3e70e /tests/test_pickle.py
parenta26c9dd0a1b20cdad4136a8f5d7c5b559e82ddd9 (diff)
downloadpyisda-a65eaf7a6d72508bc5368a6adbfe415ca3967f13.tar.gz
make classes picklable
Diffstat (limited to 'tests/test_pickle.py')
-rw-r--r--tests/test_pickle.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_pickle.py b/tests/test_pickle.py
new file mode 100644
index 0000000..cdb698d
--- /dev/null
+++ b/tests/test_pickle.py
@@ -0,0 +1,15 @@
+import unittest
+from pyisda.legs import ContingentLeg
+from pickle import dumps, loads
+import datetime
+
+class TestPickle(unittest.TestCase):
+
+ def test_contingentleg(self):
+ cl = ContingentLeg(datetime.date(2016, 11, 3),
+ datetime.date(2021, 12, 20),
+ 12,
+ True)
+ pickle = dumps(cl)
+ import pdb; pdb.set_trace()
+ cl2 = loads(pickle)