Esempio n. 1
0
 def test_non_row(self):
     string = "sc ag"
     integer = 666
     invalid_row = [[4, 5, "chips"]]
     with self.assertRaises(matrices.NotARowError):
         matrices.transpose_row(string)
     with self.assertRaises(matrices.NotARowError):
         matrices.transpose_row(integer)
     with self.assertRaises(matrices.NotARowError):
         matrices.transpose_row(invalid_row)
Esempio n. 2
0
 def test_transpose_tow(self):
     a_row_1 = [[666]]
     a_row_2 = [[23, 44, 78]]
     self.assertEqual([[666]], matrices.transpose_row(a_row_1))
     self.assertEqual([[23], [44], [78]], matrices.transpose_row(a_row_2))
Esempio n. 3
0
 def test_empty_row(self):
     empty_row = [[]]
     with self.assertRaises(matrices.EmptyRowError):
         matrices.transpose_row(empty_row)