c11833974321dc2a4c104deea84c9c44b9a96e13
1 from pseudoku
.grid
import Grid
2 from pseudoku
.grid
.constraints
import Diagonal
4 from pseudoku
.tests
import SudokuTestCase
6 class DiagonalGridTestCase(SudokuTestCase
):
7 """Tests that grids with extra non-standard constraints are solved."""
10 def test_main_diagonals(self
):
11 grid
= Grid
.from_string("""
12 3...2...7 ...3.1... ..6...4..
13 89.....54 4...5...8 61.....32
14 ..8...2.. ...5.9... 1...6...9
16 grid
.add_constraint(Diagonal(grid
, direction
='down', offset
=0))
17 grid
.add_constraint(Diagonal(grid
, direction
='up', offset
=0))
18 self
.assertSolvable(grid
, "Main diagonals (Color Sudoku, page 8)")