def test_after_scroll_up_no_max_height(): viewport = Viewport(vstart=400) viewport.set_term_size(53, 176) viewport.scroll_up() assert 0 == viewport.max_height assert 0 == viewport.h_start assert 176 == viewport.h_stop assert 0 == viewport.v_start # Looks good - didn't change assert 53 == viewport.v_stop # BUG? Should this change now? Why was it 50 before? Did anything really change?
def test_after_scroll_up(): viewport = Viewport(vstart=276) viewport.set_term_size(53, 176) viewport.max_height = 300 viewport.scroll_up() assert 300 == viewport.max_height assert 0 == viewport.h_start assert 176 == viewport.h_stop assert 276 - 53 == viewport.v_start assert 276 == viewport.v_stop
def test_after_scroll_down_scroll_up(): viewport = Viewport() viewport.set_term_size(53, 176) viewport.max_height = 300 viewport.scroll_down() assert 300 == viewport.max_height assert 0 == viewport.h_start assert 176 == viewport.h_stop assert 53 == viewport.v_start # This scrolling logic looks ok assert 106 == viewport.v_stop viewport.scroll_up() # Now we can scroll up again assert 300 == viewport.max_height assert 0 == viewport.h_start assert 176 == viewport.h_stop assert 0 == viewport.v_start assert 53 == viewport.v_stop