Ejemplo n.º 1
0
def test_incidence_ranges(model, corner_uuids, line_uuids, surface_uuids,
                          block_uuids):
    corner_incidence_count = 0
    for corner_incidence in model.incident_lines(model.corner(
            corner_uuids[0])):
        corner_incidence_count += 1
        if corner_incidence.id().string() != line_uuids[0].string(
        ) and corner_incidence.id().string() != line_uuids[2].string(
        ) and corner_incidence.id().string() != line_uuids[5].string():
            raise ValueError(
                "[Test] IncidentLineRange iteration result is not correct")
    if corner_incidence_count != 3:
        raise ValueError("[Test] IncidentLineRange should iterates on 3 Lines")

    line_incidence_count = 0
    for line_incidence in model.incident_surfaces(model.line(line_uuids[0])):
        line_incidence_count += 1
        if line_incidence.id().string() != surface_uuids[0].string(
        ) and line_incidence.id().string() != surface_uuids[1].string():
            raise ValueError(
                "[Test] IncidentSurfaceRange iteration result is not correct")
    if line_incidence_count != 2:
        raise ValueError(
            "[Test] IncidentSurfaceRange should iterates on 2 Surfaces")

    surface_incidence_count = 0
    for surface_incidence in model.incident_blocks(
            model.surface(surface_uuids[0])):
        surface_incidence_count += 1
        if surface_incidence.id().string() != block_uuids[0].string():
            raise ValueError(
                "[Test] IncidentBlockRange iteration result is not correct")
    if surface_incidence_count != 1:
        raise ValueError(
            "[Test] IncidentBlockRange should iterates on 1 Block")
Ejemplo n.º 2
0
def add_corner_line_boundary_relation(model, builder, corner_uuids,
                                      line_uuids):
    builder.add_corner_line_boundary_relationship(
        model.corner(corner_uuids[0]), model.line(line_uuids[0]))
    builder.add_corner_line_boundary_relationship(
        model.corner(corner_uuids[0]), model.line(line_uuids[5]))
    builder.add_corner_line_boundary_relationship(
        model.corner(corner_uuids[0]), model.line(line_uuids[2]))
    builder.add_corner_line_boundary_relationship(
        model.corner(corner_uuids[1]), model.line(line_uuids[0]))
    builder.add_corner_line_boundary_relationship(
        model.corner(corner_uuids[1]), model.line(line_uuids[1]))
    builder.add_corner_line_boundary_relationship(
        model.corner(corner_uuids[1]), model.line(line_uuids[3]))
    builder.add_corner_line_boundary_relationship(
        model.corner(corner_uuids[2]), model.line(line_uuids[1]))
    builder.add_corner_line_boundary_relationship(
        model.corner(corner_uuids[2]), model.line(line_uuids[2]))
    builder.add_corner_line_boundary_relationship(
        model.corner(corner_uuids[2]), model.line(line_uuids[4]))
    builder.add_corner_line_boundary_relationship(
        model.corner(corner_uuids[3]), model.line(line_uuids[5]))
    builder.add_corner_line_boundary_relationship(
        model.corner(corner_uuids[3]), model.line(line_uuids[6]))
    builder.add_corner_line_boundary_relationship(
        model.corner(corner_uuids[3]), model.line(line_uuids[8]))
    builder.add_corner_line_boundary_relationship(
        model.corner(corner_uuids[4]), model.line(line_uuids[3]))
    builder.add_corner_line_boundary_relationship(
        model.corner(corner_uuids[4]), model.line(line_uuids[6]))
    builder.add_corner_line_boundary_relationship(
        model.corner(corner_uuids[4]), model.line(line_uuids[7]))
    builder.add_corner_line_boundary_relationship(
        model.corner(corner_uuids[5]), model.line(line_uuids[4]))
    builder.add_corner_line_boundary_relationship(
        model.corner(corner_uuids[5]), model.line(line_uuids[7]))
    builder.add_corner_line_boundary_relationship(
        model.corner(corner_uuids[5]), model.line(line_uuids[8]))

    for corner_id in corner_uuids:
        for incidence in model.incident_lines(model.corner(corner_id)):
            if not find_uuid_in_list(line_uuids, incidence.id()):
                raise ValueError(
                    "[Test] All Corners incidences should be Lines")
        if model.nb_incidences(corner_id) != 3:
            raise ValueError(
                "[Test] All Corners should be connected to 3 Lines")

    for line_id in line_uuids:
        for boundary in model.boundary_corners(model.line(line_id)):
            if not find_uuid_in_list(corner_uuids, boundary.id()):
                raise ValueError(
                    "[Test] All Lines incidences should be Corners")
        if model.nb_boundaries(line_id) != 2:
            raise ValueError(
                "[Test] All Lines should be connected to 2 Corners")
Ejemplo n.º 3
0
def test_incidence_ranges( model, corner_uuids, line_uuids, surface_uuids ):
    corner_incidence_count = 0
    for corner_incidence in model.incident_lines( model.corner( corner_uuids[0] ) ):
        corner_incidence_count += 1
        if corner_incidence.id().string() != line_uuids[0].string() and corner_incidence.id().string() != line_uuids[1].string():
            raise ValueError( "[Test] IncidentLineRange iteration result is not correct" )
    if corner_incidence_count != 2:
        raise ValueError( "[Test] IncidentLineRange should iterates on 2 Lines" )

    line_incidence_count = 0
    for line_incidence in model.incident_surfaces( model.line( line_uuids[0] ) ):
        line_incidence_count += 1
        if line_incidence.id().string() != surface_uuids[0].string():
            raise ValueError( "[Test] IncidentSurfaceRange iteration result is not correct" )
    if line_incidence_count != 1:
        raise ValueError( "[Test] IncidentSurfaceRange should iterates on 1 Surface" )