-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_basic.py
57 lines (46 loc) · 1.51 KB
/
test_basic.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import pytest
from eightqueens import QueensSolver
# Total number of solutions for N Queens from 8 to 17
# Source: https://en.wikipedia.org/wiki/Eight_queens_puzzle
numberOfSolutions = [
92,
352,
724,
2680,
14200,
73712,
365596,
2279184,
14772512,
95815104
]
def test_eightqueen_solver():
solver = QueensSolver(8)
assert len(solver.solutions) == numberOfSolutions[0]
# def test_ninequeen_solver():
# solver = QueensSolver(9)
# assert len(solver.solutions) == numberOfSolutions[1]
# def test_tenqueen_solver():
# solver = QueensSolver(10)
# assert len(solver.solutions) == numberOfSolutions[2]
# def test_elevenqueen_solver():
# solver = QueensSolver(11)
# assert len(solver.solutions) == numberOfSolutions[3]
# def test_twelvequeen_solver():
# solver = QueensSolver(12)
# assert len(solver.solutions) == numberOfSolutions[4]
# def test_thirteenqueen_solver():
# solver = QueensSolver(13)
# assert len(solver.solutions) == numberOfSolutions[5]
# def test_fourteenqueen_solver():
# solver = QueensSolver(14)
# assert len(solver.solutions) == numberOfSolutions[6]
# def test_fifteenqueen_solver():
# solver = QueensSolver(15)
# assert len(solver.solutions) == numberOfSolutions[7]
# def test_sixteenqueen_solver():
# solver = QueensSolver(16)
# assert len(solver.solutions) == numberOfSolutions[8]
# def test_seventeenqueen_solver():
# solver = QueensSolver(17)
# assert len(solver.solutions) == numberOfSolutions[9]