Skip to content

Commit

Permalink
Draft: implement unit test for radial dimension
Browse files Browse the repository at this point in the history
  • Loading branch information
vocx-fc authored and yorikvanhavre committed Mar 12, 2020
1 parent 422d5f9 commit 81c2896
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions src/Mod/Draft/drafttests/test_creation.py
Expand Up @@ -119,7 +119,7 @@ def test_arc(self):
_msg(" startangle={0}, endangle={1}".format(start_angle,
end_angle))
obj = Draft.makeCircle(radius,
start_angle, end_angle)
startangle=start_angle, endangle=end_angle)
self.assertTrue(obj, "'{}' failed".format(operation))

def test_arc_3points(self):
Expand Down Expand Up @@ -189,17 +189,22 @@ def test_dimension_linear(self):
self.assertTrue(obj, "'{}' failed".format(operation))

def test_dimension_radial(self):
"""Create a radial dimension. NOT IMPLEMENTED CURRENTLY."""
"""Create a circle and then a radial dimension."""
operation = "Draft Dimension Radial"
_msg(" Test '{}'".format(operation))
a = Vector(5, 0, 0)
b = Vector(4, 3, 0)
c = Vector(0, 5, 0)
_msg(" a={0}, b={1}".format(a, b))
_msg(" c={}".format(c))
Draft.make_dimension_radial = aux._fake_function
obj = Draft.make_dimension_radial(a, b, c)
self.assertTrue(obj, "'{}' failed".format(operation))
radius = 3
start_angle = 0
end_angle = 90
_msg(" radius={}".format(radius))
_msg(" startangle={0}, endangle={1}".format(start_angle,
end_angle))
circ = Draft.makeCircle(radius,
startangle=start_angle, endangle=end_angle)
obj1 = Draft.makeDimension(circ, 0,
p3="radius", p4=Vector(1, 1, 0))
obj2 = Draft.makeDimension(circ, 0,
p3="diameter", p4=Vector(3, 1, 0))
self.assertTrue(obj1 and obj2, "'{}' failed".format(operation))

def test_bspline(self):
"""Create a BSpline of three points."""
Expand Down

0 comments on commit 81c2896

Please sign in to comment.