~suutari-olli/openlp/escape-fixes-1294111-1497637

« back to all changes in this revision

Viewing changes to tests/interfaces/openlp_core_ui/test_shortcutlistform.py

  • Committer: suutari-olli
  • Date: 2016-01-07 02:53:59 UTC
  • mfrom: (2557.2.31 openlp)
  • Revision ID: suutari.olli@gmail.com-20160107025359-q2feybbwxaoihqxr
Merge to trunk on 1/7/2015.

I noticed this branch also seems to be fixing this bug:
https://bugs.launchpad.net/openlp/+bug/1531691

However, escape item still remains buggy with problems related to resuming
video and presentations.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
###############################################################################
5
5
# OpenLP - Open Source Lyrics Projection                                      #
6
6
# --------------------------------------------------------------------------- #
7
 
# Copyright (c) 2008-2015 OpenLP Developers                                   #
 
7
# Copyright (c) 2008-2016 OpenLP Developers                                   #
8
8
# --------------------------------------------------------------------------- #
9
9
# This program is free software; you can redistribute it and/or modify it     #
10
10
# under the terms of the GNU General Public License as published by the Free  #
24
24
"""
25
25
from unittest import TestCase
26
26
 
27
 
from PyQt4 import QtCore, QtGui, QtTest
 
27
from PyQt5 import QtWidgets
28
28
 
29
29
from openlp.core.common import Registry
30
30
from openlp.core.ui.shortcutlistform import ShortcutListForm
40
40
        """
41
41
        Registry.create()
42
42
        self.setup_application()
43
 
        self.main_window = QtGui.QMainWindow()
 
43
        self.main_window = QtWidgets.QMainWindow()
44
44
        Registry().register('main_window', self.main_window)
45
45
        self.form = ShortcutListForm()
46
46
 
56
56
        Test the _adjust_button() method
57
57
        """
58
58
        # GIVEN: A button.
59
 
        button = QtGui.QPushButton()
 
59
        button = QtWidgets.QPushButton()
60
60
        checked = True
61
61
        enabled = True
62
62
        text = "new!"
63
63
 
64
64
        # WHEN: Call the method.
65
 
        with patch('PyQt4.QtGui.QPushButton.setChecked') as mocked_check_method:
 
65
        with patch('PyQt5.QtWidgets.QPushButton.setChecked') as mocked_check_method:
66
66
            self.form._adjust_button(button, checked, enabled, text)
67
67
 
68
68
            # THEN: The button should be changed.