__init__.py 文件源码

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

项目:farnsworth 作者: mechaphish 项目源码 文件源码
def test_to_xml(self):
        random_cbid = random_string(random.randint(8, 24))
        random_actions = [Decl('a', Value([Data("abcdef")])),
                          Delay(random.randint(0, 10000))]

        # create XML representation by hand
        element = Element('pov')
        cbid = Element('cbid')
        cbid.text = random_cbid
        element.append(cbid)
        replay = Element('replay')
        for action in random_actions:
            replay.append(action.to_xml())
        element.append(replay)

        # create POV and XML representation automatically
        pov = CQE_POV(random_cbid, random_actions)
        self.assertTrue(repr(pov) == ElementTree.tostring(element))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号