def test_julia(self): """ Check that Julia works. """ # Check that Julia updates every frame. screen = MagicMock(spec=Screen, colours=8, unicode_aware=False) canvas = Canvas(screen, 10, 40, 0, 0) effect = Julia(canvas) effect.reset() self.assert_blank(canvas) my_buffer = [[(32, 7, 0, 0) for _ in range(40)] for _ in range(10)] for i in range(20): effect.update(i) self.assertEqual(self.check_canvas( canvas, my_buffer, lambda value: self.assertIn(chr(value[0]), '@&9#GHh32As;:. ')), True) # Check there is no stop frame by default. self.assertEqual(effect.stop_frame, 0) # This effect should ignore events. event = object() self.assertEqual(event, effect.process_event(event))
def test_julia(self): """ Check that Julia works. """ # Check that Julia updates every frame. screen = MagicMock(spec=Screen, colours=8) canvas = Canvas(screen, 10, 40, 0, 0) effect = Julia(canvas) effect.reset() self.assert_blank(canvas) buffer = [[(32, 7, 0, 0) for _ in range(40)] for _ in range(10)] for i in range(20): effect.update(i) self.assertEqual( self.check_canvas( canvas, buffer, lambda value: self.assertIn( chr(value[0]), '@&9#GHh32As;:. ')), True) # Check there is no stop frame by default. self.assertEqual(effect.stop_frame, 0)
def test_julia(self): """ Check that Julia works. """ # Check that Julia updates every frame. screen = MagicMock(spec=Screen, colours=8) canvas = Canvas(screen, 10, 40, 0, 0) effect = Julia(canvas) effect.reset() self.assert_blank(canvas) buffer = [[(32, 7, 0, 0) for _ in range(40)] for _ in range(10)] for i in range(20): effect.update(i) self.assertEqual(self.check_canvas( canvas, buffer, lambda value: self.assertIn(chr(value[0]), '@&9#GHh32As;:. ')), True) # Check there is no stop frame by default. self.assertEqual(effect.stop_frame, 0)