Ejemplo n.º 1
0
def test_pad_draw_header_on_change(curses_mock, time_mock):
    time_mock.ctime.return_value = ctime = 'Tue Mar 25 21:00:00 2014'
    layout = EvenVerticalLayout()
    command = Command('test', 1, Mock())
    command.on_change = ('exit',)
    Pane(0, 25, 80, layout).draw_header(command)
    curses_mock.newpad().addstr.assert_has_calls([
        call(0, 0, ANY, ANY),
        call(0, 2, '1', ANY),
        call(0, 4, 'test', curses_mock.color_pair(3)),
        call(0, 9, 'chg:exit', curses_mock.color_pair(1)),
        call(0, 55, ctime)
    ])