Example #1
0
    def test_editor_mode_error_on_multiple_enter(
        self, mocker: MockerFixture, controller: Controller
    ) -> None:
        controller.enter_editor_mode_with(mocker.Mock())

        with pytest.raises(AssertionError):
            controller.enter_editor_mode_with(mocker.Mock())
Example #2
0
    def test_editor_mode_exits_after_entering(
        self, mocker: MockerFixture, controller: Controller
    ) -> None:
        controller.enter_editor_mode_with(mocker.Mock())
        controller.exit_editor_mode()

        assert not controller.is_in_editor_mode()
Example #3
0
    def test_editor_mode_entered_from_initial(
        self, mocker: MockerFixture, controller: Controller
    ) -> None:
        editor = mocker.Mock()

        controller.enter_editor_mode_with(editor)

        assert controller.is_in_editor_mode()
        assert controller.current_editor() == editor