Exemplo n.º 1
0
    def test_font_name_changed_int(self):
        # GIVEN: An instance of FontSelectPage with a mocked out "font_name_changed" signal
        instance = FontSelectPage()
        instance.font_name_changed = MagicMock()

        # WHEN: The font name changes
        instance._on_font_name_changed(5)

        # THEN: The signal should be emitted with the correct value
        assert instance.font_name_changed.emit.call_count == 0
Exemplo n.º 2
0
    def test_font_name_changed(self):
        # GIVEN: An instance of FontSelectPage with a mocked out "font_name_changed" signal
        instance = FontSelectPage()
        instance.font_name_changed = MagicMock()

        # WHEN: The font name changes
        instance._on_font_name_changed('Sans serif')

        # THEN: The signal should be emitted with the correct value
        instance.font_name_changed.emit.assert_called_once_with('Sans serif')