Exemplo n.º 1
0
    def test_calc_line_points(self):

        startpoint_1 = (75, 0)
        endpoint_1 = (0, 5)

        startpoint_2 = (225, 0)
        endpoint_2 = (300, 5)

        expected_origin_line_1 = [(75, 0), (60, 1), (45, 2), (30, 3), (15, 4),
                                  (0, 5)]
        expected_origin_line_2 = [(225, 0), (240, 1), (255, 2), (270, 3),
                                  (285, 4), (300, 5)]

        calculated_lines = TSEGeometry.calc_line_points(
            startpoint_1, endpoint_1, startpoint_2, endpoint_2, endpoint_2[1])

        assert_true(np.array_equal(calculated_lines[0],
                                   expected_origin_line_1))
        assert_true(np.array_equal(calculated_lines[1],
                                   expected_origin_line_2))
Exemplo n.º 2
0
    def test_calc_line_points_straight_line(self):

        startpoint_1 = (75, 0)
        endpoint_1 = (75, 5)

        startpoint_2 = (225, 0)
        endpoint_2 = (225, 5)

        expected_origin_straight_line_1 = [(75, 0), (75, 1), (75, 2), (75, 3),
                                           (75, 4), (75, 5)]
        expected_origin_straight_line_2 = [(225, 0), (225, 1), (225, 2),
                                           (225, 3), (225, 4), (225, 5)]

        calculated_straight_lines = TSEGeometry.calc_line_points(
            startpoint_1, endpoint_1, startpoint_2, endpoint_2, endpoint_2[1])

        assert_true(
            np.array_equal(calculated_straight_lines[0],
                           expected_origin_straight_line_1))
        assert_true(
            np.array_equal(calculated_straight_lines[1],
                           expected_origin_straight_line_2))