def test_source_select_noedit_button(self, mocked_qdialog): """ Test source select form view has OK and Cancel buttons only """ # GIVEN: Initial setup and mocks self.projector.source_available = ['11', ] self.projector.source = '11' # WHEN we create a source select widget and set edit=False select_form = SourceSelectSingle(parent=None, projectordb=self.projectordb) select_form.edit = False select_form.exec(projector=self.projector) projector = select_form.projector # THEN: Verify only 2 buttons are available self.assertEquals(len(select_form.button_box.buttons()), 2, 'SourceSelect dialog box should only have "OK" ' 'and "Cancel" buttons available')
def test_source_select_edit_button(self, mocked_qdialog): """ Test source select form edit has Ok, Cancel, Reset, and Revert buttons """ # GIVEN: Initial setup and mocks self.projector.source_available = ['11', ] self.projector.source = '11' # WHEN we create a source select widget and set edit=True select_form = SourceSelectSingle(parent=None, projectordb=self.projectordb) select_form.edit = True select_form.exec(projector=self.projector) projector = select_form.projector # THEN: Verify all 4 buttons are available self.assertEquals(len(select_form.button_box.buttons()), 4, 'SourceSelect dialog box should have "OK", "Cancel" ' '"Rest", and "Revert" buttons available')
def test_source_select_noedit_button(self, mocked_qdialog): """ Test source select form view has OK and Cancel buttons only """ # GIVEN: Initial setup and mocks self.projector.source_available = [ '11', ] self.projector.source = '11' # WHEN we create a source select widget and set edit=False select_form = SourceSelectSingle(parent=None, projectordb=self.projectordb) select_form.edit = False select_form.exec(projector=self.projector) projector = select_form.projector # THEN: Verify only 2 buttons are available self.assertEquals( len(select_form.button_box.buttons()), 2, 'SourceSelect dialog box should only have "OK" ' 'and "Cancel" buttons available')
def test_source_select_edit_button(self, mocked_qdialog): """ Test source select form edit has Ok, Cancel, Reset, and Revert buttons """ # GIVEN: Initial setup and mocks self.projector.source_available = [ '11', ] self.projector.source = '11' # WHEN we create a source select widget and set edit=True select_form = SourceSelectSingle(parent=None, projectordb=self.projectordb) select_form.edit = True select_form.exec(projector=self.projector) projector = select_form.projector # THEN: Verify all 4 buttons are available self.assertEquals( len(select_form.button_box.buttons()), 4, 'SourceSelect dialog box should have "OK", "Cancel" ' '"Rest", and "Revert" buttons available')