Esempio n. 1
0
def test_geometry():
    p1 = Point(1, 2)
    p2 = Point(2, 3)
    p3 = Point(0, 0)
    p4 = Point(0, 1)
    for c in (
            GeometryEntity,
            GeometryEntity(),
            Point,
            p1,
            Circle,
            Circle(p1, 2),
            Ellipse,
            Ellipse(p1, 3, 4),
            Line,
            Line(p1, p2),
            LinearEntity,
            LinearEntity(p1, p2),
            Ray,
            Ray(p1, p2),
            Segment,
            Segment(p1, p2),
            Polygon,
            Polygon(p1, p2, p3, p4),
            RegularPolygon,
            RegularPolygon(p1, 4, 5),
            Triangle,
            Triangle(p1, p2, p3),
    ):
        check(c, check_attr=False)
Esempio n. 2
0
def test_geometry():
    p1 = Point(1, 2)
    p2 = Point(2, 3)
    p3 = Point(0, 0)
    p4 = Point(0, 1)
    for c in (GeometryEntity, GeometryEntity(), Point, p1, Circle,
              Circle(p1, 2), Ellipse, Ellipse(p1, 3, 4), Line, Line(p1, p2),
              LinearEntity, LinearEntity(p1, p2), Ray, Ray(p1, p2), Segment,
              Segment(p1, p2), Polygon, Polygon(p1, p2, p3,
                                                p4), RegularPolygon,
              RegularPolygon(p1, 4, 5), Triangle):
        # XXX: Instance of Triangle hangs because of hasattr in check().
        # Triangle(p1,p2,p3)
        check(c)
        pass