Added a test for puzzles with diagonal constraints.
[pseudoku.git] / pseudoku / tests / integrity / simple.py
index c85f206..48cde80 100644 (file)
@@ -1,23 +1,14 @@
-from unittest import TestCase
-
 from pseudoku.grid import Grid
 
 from pseudoku.grid import Grid
 
-class SimpleGridTestCase(TestCase):
+from pseudoku.tests import SudokuTestCase
+
+class SimpleGridTestCase(SudokuTestCase):
     """Tests the solving integrity of some puzzles that can be solved using
     only elimination and uniqueness.
     """
 
     """Tests the solving integrity of some puzzles that can be solved using
     only elimination and uniqueness.
     """
 
-    def _test_single_puzzle(self, puzzle, msg=None):
-        """Solves a single puzzle and verifies that the result is, at least,
-        not incorrect.
-        """
-        
-        grid = Grid.from_string(puzzle)
-        grid.solve()
-        self.assertTrue(grid.is_filled(), msg)
-
     def test_simple(self):
     def test_simple(self):
-        self._test_single_puzzle("""
+        self.assertSolvable("""
             ...69.... 9.5..876. ..4..1.2.
             6...5...3 38.....49 7...3...2
             .7.9..3.. .231..4.8 ....83...
             ...69.... 9.5..876. ..4..1.2.
             6...5...3 38.....49 7...3...2
             .7.9..3.. .231..4.8 ....83...