openlp/tests/interfaces/openlp_plugins/songs/forms/test_editsongform.py

47 lines
1.5 KiB
Python
Raw Normal View History

2013-03-07 12:34:35 +00:00
"""
Package to test the openlp.plugins.songs.forms.editsongform package.
"""
from mock import MagicMock
from unittest import TestCase
from PyQt4 import QtGui
from openlp.core.lib import Registry
from openlp.plugins.songs.forms.editsongform import EditSongForm
class TestEditSongForm(TestCase):
2013-03-14 22:22:18 +00:00
"""
Test the EditSongForm class
"""
2013-03-07 12:34:35 +00:00
def setUp(self):
"""
Create the UI
"""
Registry.create()
2013-03-14 22:22:18 +00:00
self.app = QtGui.QApplication([])
2013-03-07 12:34:35 +00:00
self.main_window = QtGui.QMainWindow()
Registry().register(u'main_window', self.main_window)
Registry().register(u'theme_manager', MagicMock())
self.form = EditSongForm(MagicMock(), self.main_window, MagicMock())
def tearDown(self):
"""
Delete all the C++ objects at the end so that we don't have a segfault
"""
del self.form
del self.main_window
del self.app
def ui_defaults_test(self):
"""
Test that the EditSongForm defaults are correct
"""
self.assertFalse(self.form.verse_edit_button.isEnabled(), u'The verse edit button should not be enabled')
self.assertFalse(self.form.verse_delete_button.isEnabled(), u'The verse delete button should not be enabled')
self.assertFalse(self.form.author_remove_button.isEnabled(), u'The author remove button should not be enabled')
self.assertFalse(self.form.topic_remove_button.isEnabled(), u'The topic remove button should not be enabled')
2013-03-13 07:08:41 +00:00
def is_verse_edit_form_executed_test(self):
pass