Example #1
0
 def test_get_square_top_inside(self):
     marker = [2, 2]
     matrix_size = [5, 5]
     c = main.FrameSizeCheck()
     c.size = 5
     c.get_square_top(marker, matrix_size)
     self.assertEqual(c.square_a, [4, 4],
                      msg="Blad wyznaczania wierzcholka square_a")
     self.assertEqual(c.square_b, [4, 0],
                      msg="Blad wyznaczania wierzcholka square_b")
     self.assertEqual(c.square_c, [0, 4],
                      msg="Blad wyznaczania wierzcholka square_c")
     self.assertEqual(c.square_d, [0, 0],
                      msg="Blad wyznaczania wierzcholka square_d")
Example #2
0
 def test_get_frame_edge(self):
     marker = [5, 2]
     matrix = [
         [1, 1, 1, 1, 1, 1],
         [1, 1, 1, 1, 5, 5],
         [1, 1, 1, 1, 5, 5],
         [1, 1, 1, 1, 5, 5],
         [1, 1, 1, 1, 1, 1],
     ]
     matrix_size = [len(matrix[0]), len(matrix)]
     c = main.FrameSizeCheck()
     c.size = 3
     c.get_square_top(marker, matrix_size)
     c.get_frame(matrix)
     self.assertEqual(c.frame, [5, 5, 5, 5, 5, 5],
                      msg="Blad pobierania ramki blisko krawedzi")