From e8535039077c5b9d2962a9774b34638048d0e933 Mon Sep 17 00:00:00 2001 From: vocx-fc Date: Tue, 30 Jun 2020 23:32:22 -0500 Subject: [PATCH] Draft: add modules of drafttests to the proper Doxygen group This includes `auxiliary`, `draft_test_objects`, `test_airfoildat`, `test_creation`, `test_dwg`, `test_dxf`, `test_import`, `test_import_gui`, `test_import_tools`, `test_modification`, `test_oca`, `test_pivy`, `test_svg`. These are added to the `drafttests` Doxygen group so that the functions and classes contained in each module are listed appropriately in the automatically generated documentation. --- src/Mod/Draft/drafttests/auxiliary.py | 8 ++++++++ src/Mod/Draft/drafttests/draft_test_objects.py | 5 +++-- src/Mod/Draft/drafttests/test_airfoildat.py | 11 ++++++++++- src/Mod/Draft/drafttests/test_creation.py | 9 ++++++++- src/Mod/Draft/drafttests/test_dwg.py | 11 ++++++++++- src/Mod/Draft/drafttests/test_dxf.py | 11 ++++++++++- src/Mod/Draft/drafttests/test_import.py | 18 +++++++++++++++--- src/Mod/Draft/drafttests/test_import_gui.py | 18 +++++++++++++++--- src/Mod/Draft/drafttests/test_import_tools.py | 18 +++++++++++++++--- src/Mod/Draft/drafttests/test_modification.py | 11 ++++++++++- src/Mod/Draft/drafttests/test_oca.py | 11 ++++++++++- src/Mod/Draft/drafttests/test_pivy.py | 11 ++++++++++- src/Mod/Draft/drafttests/test_svg.py | 11 ++++++++++- 13 files changed, 134 insertions(+), 19 deletions(-) diff --git a/src/Mod/Draft/drafttests/auxiliary.py b/src/Mod/Draft/drafttests/auxiliary.py index edcbf63ab1..5f6927f6a8 100644 --- a/src/Mod/Draft/drafttests/auxiliary.py +++ b/src/Mod/Draft/drafttests/auxiliary.py @@ -22,8 +22,14 @@ # * * # *************************************************************************** """Auxiliary functions for the unit tests of the Draft Workbench.""" +## @package auxiliary +# \ingroup drafttests +# \brief Auxiliary functions for the unit tests of the Draft Workbench. +## \addtogroup drafttests +# @{ import traceback + from draftutils.messages import _msg @@ -69,3 +75,5 @@ def fake_function(p1=None, p2=None, p3=None, p4=None, p5=None): _msg(" p5={}".format(p5)) no_test() return True + +## @} diff --git a/src/Mod/Draft/drafttests/draft_test_objects.py b/src/Mod/Draft/drafttests/draft_test_objects.py index 12a447d671..bf6ca29b3c 100644 --- a/src/Mod/Draft/drafttests/draft_test_objects.py +++ b/src/Mod/Draft/drafttests/draft_test_objects.py @@ -34,10 +34,11 @@ Or load it as a module and use the defined function. >>> dt.create_test_file() """ ## @package draft_test_objects -# \ingroup DRAFT +# \ingroup drafttests # \brief Run this file to create a standard test document for Draft objects. -# @{ +## \addtogroup drafttests +# @{ import datetime import os diff --git a/src/Mod/Draft/drafttests/test_airfoildat.py b/src/Mod/Draft/drafttests/test_airfoildat.py index 495bcd1aee..34905b724d 100644 --- a/src/Mod/Draft/drafttests/test_airfoildat.py +++ b/src/Mod/Draft/drafttests/test_airfoildat.py @@ -21,13 +21,20 @@ # * USA * # * * # *************************************************************************** -"""Unit test for the Draft Workbench, Airfoil DAT import and export tests.""" +"""Unit tests for the Draft Workbench, Airfoil DAT import and export tests.""" +## @package test_airfoildat +# \ingroup drafttests +# \brief Unit tests for the Draft Workbench, Airfoil DAT tests. +## \addtogroup drafttests +# @{ import os import unittest + import FreeCAD as App import Draft import drafttests.auxiliary as aux + from draftutils.messages import _msg @@ -86,3 +93,5 @@ class DraftAirfoilDAT(unittest.TestCase): This is executed after each test, so we close the document. """ App.closeDocument(self.doc_name) + +## @} diff --git a/src/Mod/Draft/drafttests/test_creation.py b/src/Mod/Draft/drafttests/test_creation.py index 6a62617d54..90fad3ec06 100644 --- a/src/Mod/Draft/drafttests/test_creation.py +++ b/src/Mod/Draft/drafttests/test_creation.py @@ -21,8 +21,13 @@ # * USA * # * * # *************************************************************************** -"""Unit test for the Draft Workbench, object creation tests.""" +"""Unit tests for the Draft Workbench, object creation tests.""" +## @package test_creation +# \ingroup drafttests +# \brief Unit tests for the Draft Workbench, object creation tests. +## \addtogroup drafttests +# @{ import unittest import FreeCAD as App @@ -349,3 +354,5 @@ class DraftCreation(unittest.TestCase): This is executed after each test, so we close the document. """ App.closeDocument(self.doc.Name) + +## @} diff --git a/src/Mod/Draft/drafttests/test_dwg.py b/src/Mod/Draft/drafttests/test_dwg.py index 2542bfeacd..7e915580b4 100644 --- a/src/Mod/Draft/drafttests/test_dwg.py +++ b/src/Mod/Draft/drafttests/test_dwg.py @@ -21,13 +21,20 @@ # * USA * # * * # *************************************************************************** -"""Unit test for the Draft Workbench, DWG import and export tests.""" +"""Unit tests for the Draft Workbench, DWG import and export tests.""" +## @package test_dwg +# \ingroup drafttests +# \brief Unit tests for the Draft Workbench, DWG import and export tests. +## \addtogroup drafttests +# @{ import os import unittest + import FreeCAD as App import Draft import drafttests.auxiliary as aux + from draftutils.messages import _msg @@ -86,3 +93,5 @@ class DraftDWG(unittest.TestCase): This is executed after each test, so we close the document. """ App.closeDocument(self.doc_name) + +## @} diff --git a/src/Mod/Draft/drafttests/test_dxf.py b/src/Mod/Draft/drafttests/test_dxf.py index d53c02f743..8f6a4defde 100644 --- a/src/Mod/Draft/drafttests/test_dxf.py +++ b/src/Mod/Draft/drafttests/test_dxf.py @@ -21,13 +21,20 @@ # * USA * # * * # *************************************************************************** -"""Unit test for the Draft Workbench, DXF import and export tests.""" +"""Unit tests for the Draft Workbench, DXF import and export tests.""" +## @package test_dxf +# \ingroup drafttests +# \brief Unit tests for the Draft Workbench, DXF import and export tests. +## \addtogroup drafttests +# @{ import os import unittest + import FreeCAD as App import Draft import drafttests.auxiliary as aux + from draftutils.messages import _msg @@ -86,3 +93,5 @@ class DraftDXF(unittest.TestCase): This is executed after each test, so we close the document. """ App.closeDocument(self.doc_name) + +## @} diff --git a/src/Mod/Draft/drafttests/test_import.py b/src/Mod/Draft/drafttests/test_import.py index 0b5ef3ad64..33d56d2c3e 100644 --- a/src/Mod/Draft/drafttests/test_import.py +++ b/src/Mod/Draft/drafttests/test_import.py @@ -21,18 +21,28 @@ # * USA * # * * # *************************************************************************** -"""Unit test for the Draft Workbench, import tests.""" +"""Unit tests for the Draft Workbench, import tests.""" +## @package test_import +# \ingroup drafttests +# \brief Unit tests for the Draft Workbench, import tests. +## \addtogroup drafttests +# @{ import unittest + import drafttests.auxiliary as aux class DraftImport(unittest.TestCase): """Import the Draft modules.""" - # No document is needed to test 'import Draft' or other modules - # thus 'setUp' just draws a line, and 'tearDown' isn't defined. def setUp(self): + """Draw the header. + + This is executed before every test. + No document is needed to test the import of modules so no document + is created, and `tearDown` isn't defined. + """ aux.draw_header() def test_import_draft(self): @@ -58,3 +68,5 @@ class DraftImport(unittest.TestCase): module = "getSVG" imported = aux.import_test(module) self.assertTrue(imported, "Problem importing '{}'".format(module)) + +## @} diff --git a/src/Mod/Draft/drafttests/test_import_gui.py b/src/Mod/Draft/drafttests/test_import_gui.py index 85120aeb50..3e9c310211 100644 --- a/src/Mod/Draft/drafttests/test_import_gui.py +++ b/src/Mod/Draft/drafttests/test_import_gui.py @@ -21,18 +21,28 @@ # * USA * # * * # *************************************************************************** -"""Unit test for the Draft Workbench, GUI import tests.""" +"""Unit tests for the Draft Workbench, GUI import tests.""" +## @package test_import_gui +# \ingroup drafttests +# \brief Unit tests for the Draft Workbench, GUI import tests. +## \addtogroup drafttests +# @{ import unittest + import drafttests.auxiliary as aux class DraftGuiImport(unittest.TestCase): """Import the Draft graphical modules.""" - # No document is needed to test 'import DraftGui' or other modules - # thus 'setUp' just draws a line, and 'tearDown' isn't defined. def setUp(self): + """Draw the header. + + This is executed before every test. + No document is needed to test the import of modules so no document + is created, and `tearDown` isn't defined. + """ aux.draw_header() def test_import_gui_draftgui(self): @@ -58,3 +68,5 @@ class DraftGuiImport(unittest.TestCase): module = "draftguitools.gui_trackers" imported = aux.import_test(module) self.assertTrue(imported, "Problem importing '{}'".format(module)) + +## @} diff --git a/src/Mod/Draft/drafttests/test_import_tools.py b/src/Mod/Draft/drafttests/test_import_tools.py index 18c358cd6a..0c8be82ff9 100644 --- a/src/Mod/Draft/drafttests/test_import_tools.py +++ b/src/Mod/Draft/drafttests/test_import_tools.py @@ -21,18 +21,28 @@ # * USA * # * * # *************************************************************************** -"""Unit test for the Draft Workbench, tools import tests.""" +"""Unit tests for the Draft Workbench, tools import tests.""" +## @package test_import_tools +# \ingroup drafttests +# \brief Unit tests for the Draft Workbench, tools import tests. +## \addtogroup drafttests +# @{ import unittest + import drafttests.auxiliary as aux class DraftImportTools(unittest.TestCase): """Test for each individual module that defines a tool.""" - # No document is needed to test 'import' of other modules - # thus 'setUp' just draws a line, and 'tearDown' isn't defined. def setUp(self): + """Draw the header. + + This is executed before every test. + No document is needed to test the import of modules so no document + is created, and `tearDown` isn't defined. + """ aux.draw_header() def test_import_gui_draftedit(self): @@ -58,3 +68,5 @@ class DraftImportTools(unittest.TestCase): module = "WorkingPlane" imported = aux.import_test(module) self.assertTrue(imported, "Problem importing '{}'".format(module)) + +## @} diff --git a/src/Mod/Draft/drafttests/test_modification.py b/src/Mod/Draft/drafttests/test_modification.py index 0ef50065a5..df32c0cd27 100644 --- a/src/Mod/Draft/drafttests/test_modification.py +++ b/src/Mod/Draft/drafttests/test_modification.py @@ -21,12 +21,19 @@ # * USA * # * * # *************************************************************************** -"""Unit test for the Draft Workbench, object modification tests.""" +"""Unit tests for the Draft Workbench, object modification tests.""" +## @package test_modification +# \ingroup drafttests +# \brief Unit tests for the Draft Workbench, object modification tests. +## \addtogroup drafttests +# @{ import unittest + import FreeCAD as App import Draft import drafttests.auxiliary as aux + from FreeCAD import Vector from draftutils.messages import _msg, _wrn @@ -591,3 +598,5 @@ class DraftModification(unittest.TestCase): This is executed after each test, so we close the document. """ App.closeDocument(self.doc_name) + +## @} diff --git a/src/Mod/Draft/drafttests/test_oca.py b/src/Mod/Draft/drafttests/test_oca.py index e4f69aba3f..3119bdc5ab 100644 --- a/src/Mod/Draft/drafttests/test_oca.py +++ b/src/Mod/Draft/drafttests/test_oca.py @@ -21,13 +21,20 @@ # * USA * # * * # *************************************************************************** -"""Unit test for the Draft Workbench, OCA import and export tests.""" +"""Unit tests for the Draft Workbench, OCA import and export tests.""" +## @package test_oca +# \ingroup drafttests +# \brief Unit tests for the Draft Workbench, OCA import and export tests. +## \addtogroup drafttests +# @{ import os import unittest + import FreeCAD as App import Draft import drafttests.auxiliary as aux + from draftutils.messages import _msg @@ -86,3 +93,5 @@ class DraftOCA(unittest.TestCase): This is executed after each test, so we close the document. """ App.closeDocument(self.doc_name) + +## @} diff --git a/src/Mod/Draft/drafttests/test_pivy.py b/src/Mod/Draft/drafttests/test_pivy.py index c6039ea266..2eef150b4f 100644 --- a/src/Mod/Draft/drafttests/test_pivy.py +++ b/src/Mod/Draft/drafttests/test_pivy.py @@ -21,12 +21,19 @@ # * USA * # * * # *************************************************************************** -"""Unit test for the Draft Workbench, Coin (Pivy) tests.""" +"""Unit tests for the Draft Workbench, Coin (Pivy) tests.""" +## @package test_pivy +# \ingroup drafttests +# \brief Unit tests for the Draft Workbench, Coin (Pivy) tests. +## \addtogroup drafttests +# @{ import unittest + import FreeCAD as App import FreeCADGui as Gui import drafttests.auxiliary as aux + from draftutils.messages import _msg @@ -71,3 +78,5 @@ class DraftPivy(unittest.TestCase): This is executed after each test, so we close the document. """ App.closeDocument(self.doc_name) + +## @} diff --git a/src/Mod/Draft/drafttests/test_svg.py b/src/Mod/Draft/drafttests/test_svg.py index 7bf7069d83..210c1082c3 100644 --- a/src/Mod/Draft/drafttests/test_svg.py +++ b/src/Mod/Draft/drafttests/test_svg.py @@ -21,13 +21,20 @@ # * USA * # * * # *************************************************************************** -"""Unit test for the Draft Workbench, SVG import and export tests.""" +"""Unit tests for the Draft Workbench, SVG import and export tests.""" +## @package test_svg +# \ingroup drafttests +# \brief Unit tests for the Draft Workbench, SVG import and export tests. +## \addtogroup drafttests +# @{ import os import unittest + import FreeCAD as App import Draft import drafttests.auxiliary as aux + from draftutils.messages import _msg @@ -86,3 +93,5 @@ class DraftSVG(unittest.TestCase): This is executed after each test, so we close the document. """ App.closeDocument(self.doc_name) + +## @}