Commit 5672808f authored by Yori Fournier's avatar Yori Fournier
Browse files

Now catching the RuntimeError in case of looping grids. (see Grid.layout())

Also added a runall.sh script for the locahost tutorials.

Now I can merge to dev-tool, tests are not finished though but on the way.
parent b8871580
Pipeline #483 passed with stage
in 4 minutes and 16 seconds
......@@ -2,8 +2,6 @@ _D_MARGIN = 0.05
_D_PADDING = 0.05
_D_POS = [0.0, 0.0, 1.0, 1.0]
from . import DBUG
class Grid(object):
def __init__(self, pos=_D_POS, margin=_D_MARGIN, padding=_D_PADDING):
......@@ -20,8 +18,6 @@ class Grid(object):
def layout(self):
print(DBUG + 'I layout!')
if self.contains_a_grid():
for grid in self.getGrids():
grid.layout()
......
......@@ -81,6 +81,18 @@ class WeightedGridTestCase(unittest.TestCase):
def test_get_weights(self):
wgrid = WeightedGrid(margin=0.15, padding=0.05, weights=[0.5, 0.3, 0.6])
self.assertEqual(wgrid.getWeights(), [0.5, 0.3, 0.6])
def test_looping_grids(self):
wgrid = WeightedGrid(margin=0.15, padding=0.05)
wgrid2 = WeightedGrid(margin=0.15, padding=0.05)
self.fooFig.setGrid(wgrid)
wgrid.appendGrid(wgrid2)
wgrid2.appendGrid(wgrid)
with self.assertRaises(RuntimeError):
self.fooFig.layout()
class HorizontalWeightedGridTestCase(unittest.TestCase):
......
./tuto000.py
./tuto001.py
./tuto002.py
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment