From 77eac66ee8bf6997129bb12a58cd2208b8c17fa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20P=C3=A9rez=20de=20Castro?= Date: Fri, 27 Nov 2015 16:38:28 +0200 Subject: [PATCH] Test exception when trying to serialize duplicated annotations --- test/test_cast.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/test_cast.py b/test/test_cast.py index a73f21a..517f239 100644 --- a/test/test_cast.py +++ b/test/test_cast.py @@ -192,4 +192,8 @@ def obj_value(obj): text = hipack.dumps({"item": h}, value=obj_value) self.assertEqual(six.u(expected), _U(text)) + def test_serialize_duplicate_annotation(self): + with self.assertRaises(ValueError): + hipack.dumps({"x":0}, value=lambda x: (x, ("a", "a"))) + unpack_data(TestValue)