Ejemplo n.º 1
0
def test_filled_constructor_should_create_valid_object():
    random = Point.random()

    point = Point(x=random.x, y=random.y)

    assert point is not None
    assert point.x == random.x
    assert point.y == random.y
Ejemplo n.º 2
0
    def __build_debug(self, state):
        debug = Debug()
        debug.clean()

        for robot in state.team_yellow:
            debug.step_points.append(Point(robot.x + 10, robot.y + 10))
            debug.final_poses.append(Pose(state.ball.x + 10, state.ball.y + 10, 10))
Ejemplo n.º 3
0
    def __build_debug(self, robots_points):
        debug = Debug()
        debug.clean()

        for robot_points in robots_points:
            points = robot_points["step_points"]
            end_pose = robot_points["end_pose"]

            for point in points:
                debug.step_points.append(Point(point[0], point[1]))
            debug.final_poses.append(
                    Pose(end_pose[0], end_pose[1] + end_pose[2]))
Ejemplo n.º 4
0
    def random(cls):
        qtd_step_points = randint(2, 10)
        qtd_final_poses = randint(2, 10)
        qtd_paths = randint(2, 10)

        step_points = [Point.random() for i in range(1, qtd_step_points)]
        final_poses = [Pose.random() for i in range(1, qtd_final_poses)]
        paths = [Path.random() for i in range(1, qtd_paths)]

        return cls(step_points=step_points,
                   final_poses=final_poses,
                   paths=paths)
Ejemplo n.º 5
0
def test_eq_should_be_true_if_all_parameters_are_equal():
    point1 = Point.random()
    point2 = Point(x=point1.x, y=point1.y)

    assert point1 == point2

    point2.x = point2.x + 1

    assert point1 != point2

    point2.x = point2.x - 1
    point2.y = point2.y + 1

    assert point1 != point2
Ejemplo n.º 6
0
    def random(cls):
        qtd_points = randint(2, 10)

        points = [Point.random() for i in range(1, qtd_points)]

        return cls(points=points)
Ejemplo n.º 7
0
def test_rand_should_create_an_valid_object():
    point = Point.random()

    assert point is not None
    assert point.x is not None
    assert point.y is not None
Ejemplo n.º 8
0
def test_default_constructor_should_create_zero_object():
    point = Point()

    assert point is not None
    assert point.x == 0
    assert point.y == 0