def test_below_empty_row(self):
     Cell.switchToContentRepr()
     log.info("Testing below empty row")
     g = Grid()
     a = Cell(startRow=1, startCol=1, rowSpan=3, colSpan=5, content="a")
     b = Cell(startRow=4, startCol=1, rowSpan=1, colSpan=3, content="b")
     c = Cell(startRow=0, startCol=0, rowSpan=1, colSpan=2, content="c")
     d = Cell(startRow=4, startCol=4, rowSpan=1, colSpan=1, content="d")
     e = Cell(startRow=1, startCol=0, rowSpan=2, colSpan=1, content="e")
     g.addCell(e)
     g.addCell(a)
     g.addCell(b)
     g.addCell(c)
     g.addCell(d)
     Cell.switchToContentRepr()
     print(g)
     self.assertEqual(features.belowEmptyRow(e, c, g), -1)
     self.assertEqual(features.belowEmptyRow(c, e, g), 1)
     self.assertEqual(features.belowEmptyRow(a, b, g), 0)
     self.assertEqual(features.belowEmptyRow(c, b, g), 1)
 def test_spanned_by_same_cell(self):
     Cell.switchToContentRepr()
     log.info("Testing spanned by same cell")
     g = Grid()
     a = Cell(startRow=1, startCol=1, rowSpan=3, colSpan=5, content="a")
     b = Cell(startRow=4, startCol=1, rowSpan=1, colSpan=3, content="b")
     c = Cell(startRow=2, startCol=6, rowSpan=1, colSpan=1, content="c")
     d = Cell(startRow=4, startCol=4, rowSpan=1, colSpan=1, content="d")
     e = Cell(startRow=1, startCol=6, rowSpan=2, colSpan=1, content="e")
     g.addCell(e)
     g.addCell(a)
     g.addCell(b)
     g.addCell(c)
     g.addCell(d)
     Cell.switchToContentRepr()
     print(g)
     self.assertEqual(features.spannedBySameCell(b, d, g), 1)
     self.assertEqual(features.spannedBySameCell(c, e, g), 1)
     self.assertEqual(features.belowEmptyRow(a, b, g), 0)
     self.assertEqual(features.belowEmptyRow(c, b, g), 0)