Example #1
0
	def test_export_sudoku_returns_false_if_invalid_file_path(self):
		interface = Interface(self.file_handler_xml1)
		interface.load_sudoku_from_file(self.sudoku_import_csv)
		interface.solve_sudoku()
		self.assertFalse(interface.export_sudoku_to_file("/test/no"))
Example #2
0
	def test_export_sudoku_returns_true_if_valid_file_path(self):
		interface = Interface(self.file_handler_xml1)
		interface.load_sudoku_from_file(self.sudoku_import_csv)	
		interface.solve_sudoku()
		self.assertTrue(interface.export_sudoku_to_file(self.sudoku_export))
Example #3
0
	def test_solve_sudoku_returns_true_if_solved(self):
		interface = Interface(self.file_handler_xml1)
		interface.load_sudoku_from_file(self.sudoku_import_txt)
		self.assertTrue(interface.solve_sudoku())
Example #4
0
	def test_solve_sudoku_returns_false_if_unsupported_algorithm(self):
		interface = Interface(self.file_handler_xml1)
		interface.load_sudoku_from_file(self.sudoku_import_txt)
		interface.config.defaultAlgorithm = "MyAlgorithm"
		self.assertFalse(interface.solve_sudoku())
Example #5
0
	def test_load_sudoku_returns_false_if_matrix_has_no_valid_format(self):
		interface = Interface(self.file_handler_xml1)
		self.assertFalse(
			interface.load_sudoku_from_file(self.sudoku_import_txt)
		)
Example #6
0
	def test_load_sudoku_returns_true_for_valid_matrix_in_txt(self):
		interface = Interface(self.file_handler_xml2)
		self.assertTrue(
			interface.load_sudoku_from_file(self.sudoku_import_txt)
		)