Exemplo n.º 1
0
 def test_has_rectangle_small_true(self):
     test_matrix = [[1, 1, 1],
                    [0, 1, 0],
                    [1, 0, 1]]
     self.assertTrue(Solution.has_rectangle(test_matrix))
Exemplo n.º 2
0
 def test_has_rectangle_error(self):
     with self.assertRaises(ValueError):
         Solution.has_rectangle([1, 2])
Exemplo n.º 3
0
 def test_has_rectangle_small_false(self):
     test_matrix = [[1, 0, 1],
                    [0, 1, 0],
                    [0, 0, 0]]
     self.assertFalse(Solution.has_rectangle(test_matrix))
Exemplo n.º 4
0
 def test_has_rectangle_all_ones(self):
     test_matrix = [[1 for _ in range(3)] for _ in range(13)]
     self.assertTrue(Solution.has_rectangle(test_matrix))
Exemplo n.º 5
0
 def test_has_rectangle_all_zeroes(self):
     test_matrix = [[0 for _ in range(3)] for _ in range(6)]
     self.assertFalse(Solution.has_rectangle(test_matrix))
Exemplo n.º 6
0
 def test_has_rectangle_one_row(self):
     self.assertFalse(Solution.has_rectangle([[1 for _ in range(10)]]))
Exemplo n.º 7
0
 def test_has_rectangle_empty(self):
     self.assertFalse(Solution.has_rectangle([]))
     self.assertFalse(Solution.has_rectangle([[]]))