Ejemplo n.º 1
0
    def test_on_custom_button_clicked(self, mocked_proxy_dialog):
        """
        Test _on_custom_button when it is called whe the 'internet settings' (CustomButton1) button is not clicked.
        """
        # GIVEN: An instance of the FirstTimeForm
        frw = FirstTimeForm(None)

        # WHEN: Calling _on_custom_button_clicked with a different button to the 'internet settings button.
        frw._on_custom_button_clicked(QtWidgets.QWizard.CustomButton2)

        # THEN: The ProxyDialog should not be shown.
        mocked_proxy_dialog.assert_not_called()
Ejemplo n.º 2
0
    def test_on_custom_button_clicked_internet_settings(
            self, mocked_proxy_dialog):
        """
        Test _on_custom_button when it is called when the 'internet settings' (CustomButton1) button is clicked.
        """
        # GIVEN: An instance of the FirstTimeForm
        frw = FirstTimeForm(None)

        # WHEN: Calling _on_custom_button_clicked with the constant for the 'internet settings' button (CustomButton1)
        frw._on_custom_button_clicked(QtWidgets.QWizard.CustomButton1)

        # THEN: The ProxyDialog should be shown.
        mocked_proxy_dialog.assert_called_with(frw)
        mocked_proxy_dialog().retranslate_ui.assert_called_once()
        mocked_proxy_dialog().exec.assert_called_once()