|
17 | 17 |
|
18 | 18 | scad_test_case_templates = [ |
19 | 19 | {'name': 'polygon', 'class': 'polygon' , 'kwargs': {'paths': [[0, 1, 2]]}, 'expected': '\n\npolygon(paths = [[0, 1, 2]], points = [[0, 0], [1, 0], [0, 1]]);', 'args': {'points': [[0, 0, 0], [1, 0, 0], [0, 1, 0]]}, }, |
| 20 | + {'name': 'polygon', 'class': 'polygon' , 'kwargs': {}, 'expected': '\n\npolygon(points = [[0, 0], [1, 0], [0, 1]]);', 'args': {'points': [[0, 0, 0], [1, 0, 0], [0, 1, 0]]}, }, |
20 | 21 | {'name': 'circle', 'class': 'circle' , 'kwargs': {'segments': 12, 'r': 1}, 'expected': '\n\ncircle($fn = 12, r = 1);', 'args': {}, }, |
21 | 22 | {'name': 'circle_diam', 'class': 'circle' , 'kwargs': {'segments': 12, 'd': 1}, 'expected': '\n\ncircle($fn = 12, d = 1);', 'args': {}, }, |
22 | 23 | {'name': 'square', 'class': 'square' , 'kwargs': {'center': False, 'size': 1}, 'expected': '\n\nsquare(center = false, size = 1);', 'args': {}, }, |
@@ -219,6 +220,16 @@ def test_import_scad(self): |
219 | 220 | # are imported correctly. Not sure how to do this without writing |
220 | 221 | # temp files to those directories. Seems like overkill for the moment |
221 | 222 |
|
| 223 | + def test_imported_scad_arguments(self): |
| 224 | + include_file = self.expand_scad_path("examples/scad_to_include.scad") |
| 225 | + mod = import_scad(include_file) |
| 226 | + points = mod.scad_points(); |
| 227 | + poly = polygon(points); |
| 228 | + actual = scad_render(poly); |
| 229 | + abs_path = points._get_include_path(include_file) |
| 230 | + expected = f'use <{abs_path}>\n\n\npolygon(points = scad_points());' |
| 231 | + self.assertEqual(expected, actual) |
| 232 | + |
222 | 233 | def test_use_reserved_words(self): |
223 | 234 | scad_str = '''module reserved_word_arg(or=3){\n\tcube(or);\n}\nmodule or(arg=3){\n\tcube(arg);\n}\n''' |
224 | 235 |
|
|
0 commit comments