コード例 #1
0
 def test_find_ship_vertical(self):
     base = SeaField(5, 5)
     SeaPlayground.put_ship(base, 1, 1, 3, True)
     assert base.find_ship_by_cells(1, 2) == {(1, 1), (1, 2), (1, 3)}
コード例 #2
0
 def test_find_abcent(self):
     base = SeaField(5, 5)
     assert base.find_ship_by_cells(1, 2) == set()
コード例 #3
0
 def test_find_ship(self):
     base = SeaField(5, 5)
     SeaPlayground.put_ship(base, 1, 1, 3)
     assert base.find_ship_by_cells(2, 1) == {(1, 1), (2, 1), (3, 1)}