Merge pull request #7469 from LarryWoestman/bugfix

Path:  Fixed test00010 sensitivity to terminal column count.
This commit is contained in:
sliptonic
2022-09-10 18:14:16 -05:00
committed by GitHub

View File

@@ -72,6 +72,7 @@ class TestRefactoredTestPost(PathTestUtils.PathTestBase):
This method is called prior to each `test()` method. Add code and
objects here that are needed for multiple `test()` methods.
"""
self.maxDiff = None
self.doc = FreeCAD.ActiveDocument
self.con = FreeCAD.Console
self.docobj = FreeCAD.ActiveDocument.addObject("Path::Feature", "testpath")
@@ -191,9 +192,7 @@ G21
Empty path. Outputs all arguments.
"""
self.single_compare(
[],
"""Arguments that are shared with all postprocessors:
expected = """Arguments that are shared with all postprocessors:
--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
@@ -253,9 +252,17 @@ G21
movements (default)
--wait-for-spindle WAIT_FOR_SPINDLE
Time to wait (in seconds) after M3, M4 (default = 0.0)
""",
"--output_all_arguments",
)
"""
self.docobj.Path = Path.Path([])
postables = [self.docobj]
gcode: str = postprocessor.export(postables, "gcode.tmp", "--output_all_arguments")
# The argparse help routine turns out to be sensitive to the
# number of columns in the terminal window that the tests
# are run from. This affects the indenting in the output.
# The next couple of lines remove all of the white space.
gcode = "".join(gcode.split())
expected = "".join(expected.split())
self.assertEqual(gcode, expected)
def test00020(self):
"""Test Outputting visible arguments.