Add initial unit test for Start page.

Rebase.
This commit is contained in:
Chris Hennes
2021-01-02 21:36:14 -06:00
parent f03bd3d157
commit 55efacd398
5 changed files with 90 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ add_subdirectory(App)
set(Start_Scripts
Init.py
TestStartGui.py
)
if(BUILD_GUI)
@@ -11,18 +12,40 @@ if(BUILD_GUI)
add_subdirectory(StartPage)
endif(BUILD_GUI)
set(Start_Tests
TestStart/__init__.py
TestStart/TestStartPage.py)
set(Start_Test_Files
${Start_Tests}
${Start_Scripts})
add_custom_target(StartScripts ALL
SOURCES ${Start_Scripts}
)
add_custom_target(StartTests ALL
SOURCES ${Start_Test_Files}
)
fc_target_copy_resource(StartScripts
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_BINARY_DIR}/Mod/Start
${Start_Scripts})
fc_copy_sources(StartTests "${CMAKE_BINARY_DIR}/Mod/Start" ${Start_Test_Files})
INSTALL(
FILES
${Start_Scripts}
DESTINATION
Mod/Start
)
INSTALL(
FILES
${Start_Tests}
DESTINATION
Mod/Start/testStart
)

View File

@@ -47,3 +47,5 @@ class StartWorkbench ( Workbench ):
return "StartGui::Workbench"
Gui.addWorkbench(StartWorkbench())
FreeCAD.__unit_test__ += [ "TestStartGui" ]

View File

@@ -0,0 +1,36 @@
# -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2021 Chris Hennes <chennes@pioneerlibrarysystem.org> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it under the terms of the GNU Lesser General Public License (LGPL) *
# * as published by the Free Software Foundation; either version 2 of *
# * the License, or (at your option) any later version. *
# * for detail see the LICENCE text file. *
# * *
# * This program is distributed in the hope that it will be useful, *
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
# * GNU Library General Public License for more details. *
# * *
# * You should have received a copy of the GNU Library General Public *
# * License along with this program; if not, write to the Free Software *
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
# * USA *
# * *
# ***************************************************************************
import unittest
import FreeCAD
import Start
from StartPage import StartPage
from html.parser import HTMLParser
class TestStartPage(unittest.TestCase):
"""Basic validation of the generated Start page."""
MODULE = 'TestStartPage' # file name without extension
def setUp(self):
pass

View File

View File

@@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2021 Chris Hennes <chennes@pioneerlibrarysystem.org> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it under the terms of the GNU Lesser General Public License (LGPL) *
# * as published by the Free Software Foundation; either version 2 of *
# * the License, or (at your option) any later version. *
# * for detail see the LICENCE text file. *
# * *
# * This program is distributed in the hope that it will be useful, *
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
# * GNU Library General Public License for more details. *
# * *
# * You should have received a copy of the GNU Library General Public *
# * License along with this program; if not, write to the Free Software *
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
# * USA *
# * *
# ***************************************************************************
import TestApp
from TestStart.TestStartPage import TestStartPage
# dummy usage to get flake8 and lgtm quiet
False if TestApp.__name__ else True
False if TestStartPage.__name__ else True