Skip to content

Commit

Permalink
new tests to improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jpoullet2000 committed Jan 29, 2017
1 parent 2297d7d commit 9c383b1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
4 changes: 4 additions & 0 deletions example_module.scad
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module example() {offset(r=10){
circle(r=10);
};}
example();
19 changes: 19 additions & 0 deletions tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,20 @@ def test_offset(self):
with self.assertRaises(TypeError):
o.offset([10, 10, 10])

def test_hull(self):
c = Cube(10)
s = Sphere(3)
s = s.translate([8, 0, 0])
h = (c + s).hull()
self.assertTrue('hull' in h.dumps())

def test_minkowski(self):
c = Cube(10)
s = Sphere(3)
s = s.translate([8, 0, 0])
h = (c + s).minkowski()
self.assertTrue('minkowski' in h.dumps())

def test_linear_extrude(self):
o = Circle(10)
o1 = o.linear_extrude(height=1.6)
Expand All @@ -212,6 +226,11 @@ def test_rotate_extrude(self):
self.assertTrue(isinstance(o1, Rotate_Extrude))
self.assertEqual(o1.children, [o])

def test_scad_write(self):
sc = Scad(os.path.join(os.path.dirname(os.path.abspath(__file__)),'..','example','example.scad'))
self.assertTrue('example' in sc.dumps())
sc.write('example_module.scad')

def test_scad(self):
o = Sphere(3)
sc = Scad(os.path.join(os.path.dirname(os.path.abspath(__file__)),'..','example','example.scad'))
Expand Down

0 comments on commit 9c383b1

Please sign in to comment.