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)
test_{{cookiecutter.application_name}}.py 文件源码
python
阅读 30
收藏 0
点赞 0
评论 0
评论列表
文章目录