def test_invalid_index(self): b = Board([EMPTY_CELL]) with pytest.raises(IndexError): b.update_board(color='g', row=1, column=0)
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-', '--'])
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)
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])