Esempio n. 1
0
    def color_setter_test(self):
        """
        Test that the color property setter method sets the color
        """

        # GIVEN: An instance of ColorButton, with a mocked __init__
        with patch('openlp.core.lib.colorbutton.ColorButton.__init__', **{'return_value': None}):
            widget = ColorButton()

            # WHEN: Setting the color property
            widget.color = '#000000'

            # THEN: Then change_color should have been called with the value we set
            self.mocked_change_color.assert_called_once_with('#000000')
Esempio n. 2
0
    def color_setter_test(self):
        """
        Test that the color property setter method sets the color
        """

        # GIVEN: An instance of ColorButton, with a mocked __init__
        with patch('openlp.core.lib.colorbutton.ColorButton.__init__',
                   **{'return_value': None}):
            widget = ColorButton()

            # WHEN: Setting the color property
            widget.color = '#000000'

            # THEN: Then change_color should have been called with the value we set
            self.mocked_change_color.assert_called_once_with('#000000')