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