コード例 #1
0
def test_on_show_view_called():
    window = Window()
    view = View(window)
    show_mock = Mock()
    view.on_show_view = show_mock

    window.show_view(view)

    show_mock.assert_called_once()
    window.close()
コード例 #2
0
def test_on_hide_view_called():
    window = Window()
    view1 = View(window)
    view2 = View(window)
    window.show_view(view1)

    hide_mock = Mock()
    view1.on_hide_view = hide_mock

    window.show_view(view2)

    hide_mock.assert_called_once()
    window.close()