コード例 #1
0
ファイル: test_game.py プロジェクト: idanmel/connect4
 def test_invalid_index(self):
     b = Board([EMPTY_CELL])
     with pytest.raises(IndexError):
         b.update_board(color='g', row=1, column=0)
コード例 #2
0
ファイル: test_game.py プロジェクト: idanmel/connect4
 def test_two_dimensional_board(self):
     b = Board([EMPTY_CELL * 2, EMPTY_CELL * 2])
     b.update_board(color='r', row=0, column=0)
     assert b == Board(['r-', '--'])
コード例 #3
0
ファイル: test_game.py プロジェクト: idanmel/connect4
 def test_cell_is_taken(self):
     b = Board([EMPTY_CELL])
     b.update_board(color='r', row=0, column=0)
     with pytest.raises(CellIsNotEmpty):
         b.update_board(color='g', row=0, column=0)
コード例 #4
0
ファイル: test_game.py プロジェクト: idanmel/connect4
 def test_one_dimensional_board(self):
     b = Board([EMPTY_CELL * 7])
     b.update_board(color='r', row=0, column=0)
     assert b == Board(['r' + EMPTY_CELL * 6])