diff --git a/tests/serializers/test_pickle_serializer.py b/tests/serializers/test_pickle_serializer.py index 0b94b19..15de9d1 100644 --- a/tests/serializers/test_pickle_serializer.py +++ b/tests/serializers/test_pickle_serializer.py @@ -1,16 +1,26 @@ # -*- coding: utf-8 -*- +from benedict.serializers import Base64Serializer from benedict.serializers import PickleSerializer +import datetime as dt import unittest class pickle_serializer_test_case(unittest.TestCase): def test_decode_pickle(self): - # TODO - pass + s = 'gAN9cQBYBAAAAGRhdGVxAWNkYXRldGltZQpkYXRldGltZQpxAkMKB8EEAwAAAAAAAHEDhXEEUnEFcy4=' + d = Base64Serializer().decode(s, subformat='pickle') + r = { + 'date': dt.datetime(year=1985, month=4, day=3), + } + self.assertEqual(d, r) def test_encode_pickle(self): - # TODO - pass + d = { + 'date': dt.datetime(year=1985, month=4, day=3), + } + s = Base64Serializer().encode(d, subformat='pickle') + r = 'gAN9cQBYBAAAAGRhdGVxAWNkYXRldGltZQpkYXRldGltZQpxAkMKB8EEAwAAAAAAAHEDhXEEUnEFcy4=' + self.assertEqual(s, r)