Coverage for tests/unit/lib/gl/test_util.py: 100%

11 statements  

« prev     ^ index     » next       coverage.py v7.4.4, created at 2024-03-20 05:56 +0000

1import unittest 

2from tatlin.lib.gl.util import compile_display_list, html_color, paginate 

3 

4 

5class UtilTest(unittest.TestCase): 

6 def test_compile_display_list(self): 

7 dl = compile_display_list(lambda x: x, 1) 

8 

9 def test_paginate(self): 

10 paginated = paginate(list(range(10)), 3) 

11 self.assertListEqual(list(paginated), [[0, 1, 2], [3, 4, 5], [6, 7, 8], [9]]) 

12 

13 def test_html_color(self): 

14 self.assertEqual(html_color("#ff0000"), [1.0, 0, 0]) 

15 self.assertEqual(html_color("ff0000"), [1.0, 0, 0])