-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_nqueens.py
45 lines (26 loc) · 909 Bytes
/
test_nqueens.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
import pytest
from n_queens import NQueens
def test_solutions_brute_force_eight():
problem = NQueens(8,1)
assert problem.solutions_count == 92
assert len(problem.solutions) == 92
def test_solutions_brute_force_nine():
problem = NQueens(9,1)
assert problem.solutions_count == 352
assert len(problem.solutions) == 352
def test_solutions_brute_force_ten():
problem = NQueens(10,1)
assert problem.solutions_count == 724
assert len(problem.solutions) == 724
def test_solutions_backtracking_eight():
problem = NQueens(8,2)
assert problem.solutions_count == 92
assert len(problem.solutions) == 92
def test_solutions_backtracking_nine():
problem = NQueens(9,2)
assert problem.solutions_count == 352
assert len(problem.solutions) == 352
def test_solutions_backtracking_ten():
problem = NQueens(10,2)
assert problem.solutions_count == 724
assert len(problem.solutions) == 724