예제 #1
0
 def test_set_border_edge(self):
     base = SeaField(4, 4)
     base.set_border(0, 0, 2, True)
     base.set_border(2, 3, 2)
     border = [(1, 0), (1, 1), (0, 2), (1, 2),
               (2, 2), (3, 2), (1, 3)]
     for cell in base._cells:
         if (cell.x, cell.y) in border:
             assert cell.value == Cell.BORDER
         else:
             assert cell.value == Cell.EMPTY
예제 #2
0
 def test_set_border(self):
     base = SeaField(5, 5)
     base.set_border(1, 1, 3)
     border = [(0, 0), (1, 0), (2, 0), (3, 0), (4, 0),
               (0, 1), (4, 1),
               (0, 2), (1, 2), (2, 2), (3, 2), (4, 2)]
     for cell in base._cells:
         if (cell.x, cell.y) in border:
             assert cell.value == Cell.BORDER
         else:
             assert cell.value == Cell.EMPTY