Path: Added more tests and fixed some parameter handling.

Refactored axis and feed number formatting.
       Used "with" for file writes, removed "pythonopen".
This commit is contained in:
LarryWoestman
2022-07-06 20:21:23 -07:00
parent 494a08f3f8
commit d0b3ea3779
4 changed files with 52 additions and 115 deletions

View File

@@ -21,8 +21,6 @@
# * *
# ***************************************************************************
from importlib import reload
import FreeCAD
import Path
@@ -192,7 +190,7 @@ G21
Empty path. Outputs all arguments.
"""
expected = """Arguments that are shared with all postprocessors:
expected = """Arguments that are commonly used:
--metric Convert output for Metric mode (G21) (default)
--inches Convert output for US imperial mode (G20)
--axis-modal Don't output axis values if they are the same as the
@@ -246,10 +244,10 @@ G21
--tool_change Insert M6 and any other tool change G-code for all
tool changes (default)
--no-tool_change Convert M6 to a comment for all tool changes
--translate_drill Translate drill cycles G81, G82 & G83 into G0/G1
--translate_drill Translate drill cycles G73, G81, G82 & G83 into G0/G1
movements
--no-translate_drill Don't translate drill cycles G81, G82 & G83 into G0/G1
movements (default)
--no-translate_drill Don't translate drill cycles G73, G81, G82 & G83 into
G0/G1 movements (default)
--wait-for-spindle WAIT_FOR_SPINDLE
Time to wait (in seconds) after M3, M4 (default = 0.0)
"""
@@ -363,7 +361,9 @@ G21
def test00160(self):
"""Test inches."""
#
c = Path.Command("G0 X10 Y20 Z30 A10 B20 C30 U10 V20 W30")
self.docobj.Path = Path.Path([c])
postables = [self.docobj]
args = "--inches"
@@ -889,7 +889,7 @@ G52 X0.0000 Y0.0000 Z0.0000 A0.0000 B0.0000 C0.0000 U0.0000 V0.0000 W0.0000
#
# Some gcode interpreters use G59 P- to select additional
# work coordinate systems. This is considered somewhat
# obsolete and is being replaces by G54.1 P- instead.
# obsolete and is being replaced by G54.1 P- instead.
#
self.compare_third_line("G59 P2.34567", "G59 P2", "")