Exemple #1
0
 def test_one_element_matrix(self):
     self.assertEqual(zeroMatrix([[1]]), [[1]])
Exemple #2
0
 def test_no_zeroes(self):
     self.assertEqual(zeroMatrix([[1, 2], [3, 4]]), [[1, 2], [3, 4]])
Exemple #3
0
 def test_empty_matrix(self):
     self.assertEqual(zeroMatrix([[]]), [[]])
Exemple #4
0
 def test_all_zeroes(self):
     self.assertEqual(zeroMatrix([[0, 0], [0, 0]]), [[0, 0], [0, 0]])
Exemple #5
0
 def test_three_by_three(self):
     self.assertEqual(zeroMatrix([[2, 1, 2], [0, 4, 0], [6, 7, 0]]),
                      [[0, 1, 0], [0, 0, 0], [0, 0, 0]])
Exemple #6
0
 def test_two_by_three_two_zeroes(self):
     self.assertEqual(zeroMatrix([[0, 0, 3], [2, 1, 4]]),
                      [[0, 0, 0], [0, 0, 4]])
Exemple #7
0
 def test_two_by_three_one_zero(self):
     self.assertEqual(zeroMatrix([
         [1, 0, 2],
         [3, 4, 5],
     ]), [[0, 0, 0], [3, 0, 5]])
Exemple #8
0
 def test_two_by_two_matrix(self):
     self.assertEqual(zeroMatrix([[1, 2], [3, 0]]), [[1, 0], [0, 0]])