File tree Expand file tree Collapse file tree 4 files changed +35
-2
lines changed
src/compas/geometry/primitives Expand file tree Collapse file tree 4 files changed +35
-2
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ def __eq__(self, other):
145145 try :
146146 other_plane = other [0 ]
147147 other_radius = other [1 ]
148- except Exception :
148+ except : # noqa: E722
149149 return False
150150 return self .plane == other_plane and self .radius == other_radius
151151
Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ def __eq__(self, other):
147147 try :
148148 other_start = other [0 ]
149149 other_end = other [1 ]
150- except Exception :
150+ except : # noqa: E722
151151 return False
152152 return self .start == other_start and self .end == other_end
153153
Original file line number Diff line number Diff line change 1+ from compas .geometry import Circle
2+ from compas .geometry import Plane # noqa: F401
3+ from compas .geometry import Point # noqa: F401
4+ from compas .geometry import Vector # noqa: F401
5+
6+
7+ def test_circle ():
8+ point = [0 , 0 , 0 ]
9+ vector = [1 , 0 , 0 ]
10+ plane = (point , vector )
11+ c = Circle (plane , 1.0 )
12+ assert c .radius == 1.0
13+ assert c .plane == plane
14+ assert c == (plane , 1.0 )
15+ assert c == Circle (plane , 1.0 )
16+ assert c != 1.0
17+ assert c != (plane , 2.0 )
18+ assert c == eval (repr (c ))
Original file line number Diff line number Diff line change 1+ from compas .geometry import Line
2+ from compas .geometry import Point # noqa: F401
3+
4+
5+ def test_line ():
6+ p1 = [0 , 0 , 0 ]
7+ p2 = [1 , 0 , 0 ]
8+ line = Line (p1 , p2 )
9+ assert line .start == p1
10+ assert line .end == p2
11+ assert (p1 , p2 ) == line
12+ assert line == Line (p1 , p2 )
13+ assert line != (p2 , p1 )
14+ assert line != 1
15+ assert line == eval (repr (line ))
You can’t perform that action at this time.
0 commit comments