Commits

Jason R. Coombs committed b031a6a

Adding test for dict subclasses

  • Participants
  • Parent commits f743270

Comments (0)

Files changed (1)

File tests/test_main.py

 	assert isinstance(restored, TestObject)
 	assert isinstance(restored.val, TestObject)
 	assert restored.val.val == 'child'
+
+class MyDict(dict):
+	pass
+
+def test_encode_dict_subclass():
+	d = MyDict(a=3, b=4)
+	encoded = jaraco.modb.encode(d)
+	assert 'MyDict' in encoded
+	decoded = jaraco.modb.decode(encoded)
+	assert isinstance(decoded, MyDict)