test_{{cookiecutter.application_name}}.py 文件源码

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

项目:cookiecutter-pyqt5 作者: mandeep 项目源码 文件源码
def test_open_file(window, qtbot, mock):
    """Test the Open File item of the File submenu.

    Qtbot clicks on the file sub menu and then navigates to the Open File item. Mock creates
    an object to be passed to the QFileDialog.
    """
    qtbot.mouseClick(window.file_sub_menu, Qt.LeftButton)
    qtbot.keyClick(window.file_sub_menu, Qt.Key_Down)
    mock.patch.object(QFileDialog, 'getOpenFileName', return_value=('', ''))
    qtbot.keyClick(window.file_sub_menu, Qt.Key_Enter)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号