def test_scroll(self): """ Check that Scroll works. """ # Check that it will attempt to scroll the screen at the required rate. screen = MagicMock(spec=Screen, colours=8) effect = Scroll(screen, 2) effect.reset() effect.update(1) screen.scroll.assert_not_called() effect.update(2) screen.scroll.assert_called_once() # Check there is no stop frame self.assertEqual(effect.stop_frame, 0)
def test_scroll(self): """ Check that Scroll works. """ # Check that it will attempt to scroll the screen at the required rate. screen = MagicMock(spec=Screen, colours=8, unicode_aware=False) effect = Scroll(screen, 2) effect.reset() effect.update(1) screen.scroll.assert_not_called() effect.update(2) screen.scroll.assert_called_once() # Check there is no stop frame self.assertEqual(effect.stop_frame, 0) # This effect should ignore events. event = object() self.assertEqual(event, effect.process_event(event))