def test_find_emptyspot(self): from sudoku_board import SudokuBoard sudoku_board = [[5, 3, 0, 0, 7, 0, 0, 0, 0], [6, 0, 0, 1, 9, 5, 0, 0, 0], [0, 9, 8, 0, 0, 0, 0, 6, 0], [8, 0, 0, 0, 6, 0, 0, 0, 3], [4, 0, 0, 8, 0, 3, 0, 0, 1], [7, 0, 0, 0, 2, 0, 0, 0, 6], [0, 6, 0, 0, 0, 0, 2, 8, 0], [0, 0, 0, 4, 1, 9, 0, 0, 5], [0, 0, 0, 0, 8, 0, 0, 7, 9]] board = SudokuBoard(sudoku_board) self.assertTrue(board.find_emptyspot().column == 3) self.assertTrue(board.find_emptyspot().row == 1)
def test_find_emptyspot_full(self): from sudoku_board import SudokuBoard sudoku_board = [ [1, 2, 3, 4, 5, 6, 7, 8, 9], # this sudoku board is not right but it [2, 3, 4, 5, 6, 7, 8, 9, 1], # doesn't matter we are testing if the board [3, 4, 5, 6, 7, 8, 9, 1, 2], # is correctly implemented in sudoku board [4, 5, 6, 7, 8, 9, 1, 2, 3], [5, 6, 7, 8, 9, 1, 2, 3, 4], [6, 7, 8, 9, 1, 2, 3, 4, 5], [7, 8, 9, 1, 2, 3, 4, 5, 6], [8, 9, 1, 2, 3, 4, 5, 6, 7], [9, 1, 2, 3, 4, 5, 6, 7, 8] ] board = SudokuBoard(sudoku_board) self.assertTrue(board.find_emptyspot() is None)