Пример #1
0
    def test_keypress_ENTER_TOGGLE_TOPIC(
        self,
        mocker: MockerFixture,
        stream_button: StreamButton,
        key: str,
        widget_size: Callable[[Widget], urwid_Size],
    ) -> None:
        size = widget_size(stream_button)
        stream_button.view.left_panel = mocker.Mock()
        stream_button.keypress(size, key)

        stream_button.view.left_panel.show_topic_view.assert_called_once_with(
            stream_button)
Пример #2
0
 def test_keypress_TOGGLE_MUTE_STREAM(
     self,
     mocker: MockerFixture,
     key: str,
     widget_size: Callable[[Widget], urwid_Size],
     stream_button: StreamButton,
     stream_id: int = 205,
     stream_name: str = "PTEST",
 ) -> None:
     size = widget_size(stream_button)
     pop_up = mocker.patch(
         "zulipterminal.core.Controller.stream_muting_confirmation_popup")
     stream_button.keypress(size, key)
     pop_up.assert_called_once_with(stream_id, stream_name)