Skip to content

Commit

Permalink
Merge pull request #5282 from kivy/grid_boundscheck
Browse files Browse the repository at this point in the history
Add test for _init_rows_cols_sizes
  • Loading branch information
KeyWeeUsr committed Jul 16, 2017
2 parents 2ad58a9 + acf4c24 commit e4a8a4b
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion kivy/tests/test_uix_gridlayout.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
'''

import unittest
from kivy.tests.common import GraphicUnitTest

from kivy.uix.gridlayout import GridLayout


class UixGridLayoutTest(unittest.TestCase):
class GridLayoutTest(unittest.TestCase):

def test_gridlayout_get_max_widgets_cols_rows_None(self):
gl = GridLayout()
Expand Down Expand Up @@ -37,3 +38,19 @@ def test_gridlayout_get_max_widgets_with_rows_cols(self):
expected = 15
value = gl.get_max_widgets()
self.assertEqual(expected, value)


class UixGridLayoutTest(GraphicUnitTest):

def test_rows_cols_sizes(self):
# ref github issue #5278 _init_rows_cols_sizes fix
# this combination could trigger an error
gl = GridLayout()
gl.cols = 1
gl.cols_minimum = {i: 10 for i in range(10)}
gl.add_widget(GridLayout())
self.render(gl)


if __name__ == '__main__':
unittest.main()

0 comments on commit e4a8a4b

Please sign in to comment.