Skip to content

Commit

Permalink
topology: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BogdanTheGeek committed Feb 21, 2024
1 parent 355a53f commit 2c3238a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/build123d/topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -1853,9 +1853,9 @@ def geom_type(self) -> GeomType:

shape: TopAbs_ShapeEnum = shapetype(self.wrapped)

if shape is ta.TopAbs_EDGE:
if shape == ta.TopAbs_EDGE:
geom = geom_LUT_EDGE[BRepAdaptor_Curve(self.wrapped).GetType()]
elif shape is ta.TopAbs_FACE:
elif shape == ta.TopAbs_FACE:
geom = geom_LUT_FACE[BRepAdaptor_Surface(self.wrapped).GetType()]
else:
geom = GeomType.OTHER
Expand Down Expand Up @@ -5083,7 +5083,9 @@ def project_to_shape(
def to_axis(self) -> Axis:
"""Translate a linear Edge to an Axis"""
if self.geom_type() != GeomType.LINE:
raise ValueError("to_axis is only valid for linear Edges")
raise ValueError(
"to_axis is only valid for linear Edges not " + self.geom_type()
)
return Axis(self.position_at(0), self.position_at(1) - self.position_at(0))


Expand Down
2 changes: 1 addition & 1 deletion tests/test_importers.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_import_svg_as_buildline_code(self):
test_obj: BuildLine = ex_locals[builder_name]
found = 0
for edge in test_obj.edges():
if edge.geom_type() == GeomType.ELLIPSE:
if edge.geom_type() == GeomType.BEZIER:
found += 1
elif edge.geom_type() == GeomType.LINE:
found += 1
Expand Down

0 comments on commit 2c3238a

Please sign in to comment.