def test_mask_body_with_deep_item(self):
body = jsonpickle.decode("""
{
"a": [1, 2, 3, {"b": 1}],
"b": [1, 2, 3, {"c": 1}],
"c": 123,
"d": "a string"
}
""")
masks = ['c', 'd']
result = mask_body(body, masks)
self.assertIsNone(result.get('d'))
self.assertIsNone(result['b'][3].get('c'))
评论列表
文章目录