Пример #1
0
 def test_json_method(self):
     obj = lambda: 1
     obj.__json__ = lambda: "anotherjson"
     self.assertEqual("anotherjson", encode(obj))
Пример #2
0
 def test_asis(self):
     obj = [1, 2]
     self.assertEqual("[1, 2]", encode(obj))
Пример #3
0
 def test_json(self):
     obj = lambda: 1
     obj.json = "myjson"
     self.assertEqual("myjson", encode(obj))