generated from alu-rwa-dsa/Final-Jan-April-2022
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_sudoku.py
43 lines (26 loc) · 1.08 KB
/
test_sudoku.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
#Importing the unit test module
import unittest
import solver
import gui
class Testcases(unittest.TestCase):
#Testing when no value if filled in the sudoku
def test_nothing(self):
self.assertTrue("shouldn't happen")
#Testing if the sudoku is completely filled
def test_sudoku_is_complete(self):
self.assertTrue("sudoku solved!")
#Testing for duplicate column values
def test_duplicate_column_values(self):
self.assertTrue("Please ensure there are no duplicate values in the columns!")
#Testing for duplicate_grid_values
def test_duplicate_grid_values(self):
self.assertTrue("Ensure there are no duplicate values in the same grid!")
#Testing if the values in the puzzle are less than 17
def test_puzzle_value_less_than17(self):
self.assertTrue("Enter a correct number of values")
# Testing for duplicate row values
def test_duplicate_row_values(self):
self.assertTrue("Please ensure there are no duplicate values in the rows!")
#Driver code
if __name__ == '__main__':
unittest.main()