objects_test.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:auxi.0 作者: Ex-Mente 项目源码 文件源码
def test__str__(self):
        """
        Test whether the __str__ method successfully generates a json string
        representation of the object.
        """

        # Confirm that the string representation of the current object and that
        # of an object decoded from this string representation are equal.
        str_o = str(self.o)
        new_o = jsonpickle.decode(str_o)
        self.assertEqual(str_o, str(new_o))

        # Confirm that the property values are preserved through string
        # encoding and decoding.
        self.assertEqual(new_o.name, 'NameA')
        self.assertEqual(new_o.description, 'DescriptionA')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号