Esempio n. 1
0
    def test_quick_transformation(self):
        list_of_lines1 = ['[1, 2, 3, 4]']
        result1 = [[1, 2, 3, 4], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
        quick_flag = True
        self.assertEqual(
            ExtractInputData.transformation(list_of_lines1, quick_flag),
            result1)
        list_of_lines2 = ['[0, 0, 0, 0]']

        result2 = [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
        self.assertEqual(
            ExtractInputData.transformation(list_of_lines2, quick_flag),
            result2)
Esempio n. 2
0
 def test_transformation(self):
     list_of_lines = [
         '[1, 2, 3, 4]', '[5 6 7 8]', '[9,10,11,12]', '[12, 13, 14, 15]'
     ]
     result = [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12],
               [12, 13, 14, 15]]
     quick_flag = False
     self.assertEqual(
         ExtractInputData.transformation(list_of_lines, quick_flag), result)
Esempio n. 3
0
 def test_transformation_incorrect_input(self):
     list_of_lines = ['[1, 2, 3, 4]', '[5 6 7 8]', '[9,10,11,12]']
     quick_flag = False
     with self.assertRaises(IncorrectSudokuSizeError):
         ExtractInputData.transformation(list_of_lines, quick_flag)