removed not needed mocks and calls

This commit is contained in:
Andreas Preikschat 2013-04-08 20:30:11 +02:00
parent 352d8da185
commit d504b314ef

View File

@ -40,11 +40,10 @@ class TestEditCustomForm(TestCase):
"""
Test the load_themes() method.
"""
# GIVEN: A mocked QDialog.exec_() method
with patch(u'PyQt4.QtGui.QDialog.exec_') as mocked_exec:
# GIVEN: A theme list.
theme_list = [u'First Theme', u'Second Theme']
# WHEN: Show the dialog and add pass a theme list.
self.form.exec_()
self.form.load_themes(theme_list)
# THEN: There should be three items in the combo box.
@ -54,10 +53,7 @@ class TestEditCustomForm(TestCase):
"""
Test the load_custom() method.
"""
# GIVEN: A mocked QDialog.exec_() method
with patch(u'PyQt4.QtGui.QDialog.exec_') as mocked_exec:
# WHEN: Show the dialog and create a new custom item.
self.form.exec_()
# WHEN: Create a new custom item.
self.form.load_custom(0)
# THEN: The line edits should not contain any text.
@ -71,8 +67,8 @@ class TestEditCustomForm(TestCase):
"""
# GIVEN: A mocked QDialog.exec_() method
with patch(u'PyQt4.QtGui.QDialog.exec_') as mocked_exec:
# WHEN: Show the dialog and add a new slide.
self.form.exec_()
# WHEN: Add a new slide.
QtTest.QTest.mouseClick(self.form.add_button, QtCore.Qt.LeftButton)
# THEN: One slide should be added.
assert self.form.slide_list_view.count() == 1, u'There should be one slide added.'