test_ui_base.py 文件源码

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

项目:PyWallet 作者: AndreMiras 项目源码 文件源码
def helper_test_dismiss_dialog_twice(self, app):
        """
        If by some choice the dismiss event of a dialog created with
        Controller.create_dialog_helper() is fired twice, it should be
        handled gracefully, refs #89.
        """
        Controller = main.Controller
        title = "title"
        body = "body"
        # makes sure the controller has no dialog
        self.assertEqual(Controller.dialogs, [])
        # creates one and verifies it was created
        dialog = Controller.create_dialog_helper(title, body)
        self.assertEqual(len(Controller.dialogs), 1)
        # dimisses it once and verifies it was handled
        dialog.dispatch('on_dismiss')
        self.assertEqual(Controller.dialogs, [])
        # then a second time and it should not crash
        dialog.dispatch('on_dismiss')
        self.assertEqual(Controller.dialogs, [])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号