def setUp(self): unittest.TestCase.setUp(self) filename4 = 'Puzzle-4x4-0001.txt' filename9 = 'Puzzle-9x9-0001.txt' filename16 = 'Puzzle-16x16-0001-Inconsistant.txt' self.puzzle4x4 = FileHandler.create_puzzle(filename4) self.puzzle9x9 = FileHandler.create_puzzle(filename9) self.puzzle16x16 = FileHandler.create_puzzle(filename16) self.assertEqual(4, self.puzzle4x4.size) self.assertEqual(9, self.puzzle9x9.size) self.assertEqual(16, self.puzzle16x16.size)
from filehandler import FileHandler filename = "Puzzle-9x9-0305.txt" # filename = 'Puzzle-16x16-0001-Inconsistant.txt' # filename = 'Puzzle-25x25-0001-Inconsistant.txt' # filename = 'Puzzle-9x9-0101.txt' # filename = 'Puzzle-9x9-0203.txt' # filename = 'Puzzle-9x9-0000-Unsolvable.txt' puzzle = FileHandler.create_puzzle(filename) puzzle.solve()
def test_load_4x4_puzzle(self): filename = 'Puzzle-4x4-0001.txt' puzzle = FileHandler.create_puzzle(filename) self.assertEqual(4,puzzle.size)
def test_load_16x16_puzzle(self): filename = 'Puzzle-16x16-0001-Inconsistant.txt' puzzle = FileHandler.create_puzzle(filename) self.assertEqual(16,puzzle.size)
def test_load_9x9_puzzle(self): filename = 'Puzzle-9x9-0001.txt' puzzle = FileHandler.create_puzzle(filename) self.assertEqual(9,puzzle.size)