def test_is_valid_cell_value_placed(unsolved): cell = (5, 1) value = 1 unsolved[cell] = value assert is_valid_cell(unsolved, cell) is True
def test_is_not_valid_cell_row_value_placed(unsolved): cell = (2, 4) value = 6 unsolved[cell] = value assert is_valid_cell(unsolved, cell) is False
def test_is_not_valid_cell_column(unsolved): cell = (6, 6) value = 8 assert is_valid_cell(unsolved, cell, value) is False
def test_is_not_valid_cell_box(unsolved): cell = (1, 4) value = 7 assert is_valid_cell(unsolved, cell, value) is False
def test_is_valid_cell(unsolved): cell = (5, 1) value = 1 assert is_valid_cell(unsolved, cell, value) is True
def test_is_not_valid_cell_row(unsolved): cell = (2, 4) value = 6 assert is_valid_cell(unsolved, cell, value) is False
def test_is_valid_cell_zero_placed(one_missing): cell = (4, 4) assert is_valid_cell(one_missing, cell) is False
def test_is_valid_cell_zero(one_missing): cell = (0, 0) value = 0 assert is_valid_cell(one_missing, cell, value) is False
def test_is_not_valid_cell_already_placed(solved): cell = (4, 4) value = solved[cell] + 1 assert is_valid_cell(solved, cell, value) is False
def test_is_valid_cell_already_placed_wrong(solved): cell = (4, 4) value = solved[cell] solved[cell] = value + 1 assert is_valid_cell(solved, cell, value) is True
def test_is_valid_cell_already_placed(solved): cell = (4, 4) value = solved[cell] assert is_valid_cell(solved, cell, value) is True
def test_is_not_valid_cell_box_value_placed(unsolved): cell = (1, 4) value = 7 unsolved[cell] = value assert is_valid_cell(unsolved, cell) is False
def test_is_not_valid_cell_column_value_placed(unsolved): cell = (6, 6) value = 8 unsolved[cell] = value assert is_valid_cell(unsolved, cell) is False