Rename unittest_file item to unittest
- constants.py: TYPE_UNITTEST_FILE → TYPE_UNITTEST, cmd "unittest_file" → "unittest" - All Python files updated: test_item_unittest.py, test_set.py, test_init.py, terminal.py, report_export_txt.py, test_tree_item.py - All .tum files updated (examples, validation, doc) - Sphinx doc: unittest_file_test_item.rst → unittest_test_item.rst, all references updated Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
|
||||
- unittest_file:
|
||||
- unittest:
|
||||
name: Test 5
|
||||
test_file: dummy.py
|
||||
|
||||
@@ -3,7 +3,7 @@ sequence: &endurance_test
|
||||
!include endurance.tum
|
||||
|
||||
sequence:
|
||||
- unittest_file:
|
||||
- unittest:
|
||||
name: Test 3
|
||||
test_file: dummy.py
|
||||
test_method: test_01_pass
|
||||
@@ -11,6 +11,6 @@ sequence:
|
||||
iterator: 10
|
||||
steps:
|
||||
*endurance_test
|
||||
- unittest_file:
|
||||
- unittest:
|
||||
name: Test 4
|
||||
test_file: dummy.py
|
||||
|
||||
@@ -15,7 +15,7 @@ main:
|
||||
- $(reference_1)
|
||||
- $(reference_2)
|
||||
report_show_success: true
|
||||
- unittest_file:
|
||||
- unittest:
|
||||
name: Test 1
|
||||
test_file: dummy.py
|
||||
doc: |
|
||||
@@ -23,7 +23,7 @@ main:
|
||||
Voilà...
|
||||
- sleep:
|
||||
{name: Sleep between one and two, timeout: 10, dialog: true}
|
||||
- unittest_file:
|
||||
- unittest:
|
||||
{name: Test 2, test_file: dummy.py,execute_on_stop: true}
|
||||
- loop:
|
||||
name: Cycle Temperature
|
||||
|
||||
@@ -14,7 +14,7 @@ main:
|
||||
key: report-key-2
|
||||
stop_on_failure: True
|
||||
steps:
|
||||
- unittest_file:
|
||||
- unittest:
|
||||
name: unittest item
|
||||
doc: |
|
||||
The purpose of this unittest test item is to demonstrate
|
||||
@@ -41,7 +41,7 @@ main:
|
||||
param:
|
||||
- 123
|
||||
|
||||
- unittest_file:
|
||||
- unittest:
|
||||
name: Unittest item
|
||||
test_file: dummy/dummy.py
|
||||
test_method:
|
||||
@@ -98,7 +98,7 @@ main:
|
||||
name: Infine loop unittest step crashes
|
||||
stop_on_failure: True
|
||||
steps:
|
||||
- unittest_file:
|
||||
- unittest:
|
||||
name: Unittest item
|
||||
test_file: dummy/dummy.py
|
||||
test_method:
|
||||
@@ -243,7 +243,7 @@ main:
|
||||
name: Infinite loop
|
||||
skipped: True
|
||||
steps:
|
||||
- unittest_file:
|
||||
- unittest:
|
||||
name: Unittest item
|
||||
test_file: dummy/dummy.py
|
||||
test_method: test_01_pass
|
||||
|
||||
@@ -9,7 +9,7 @@ main:
|
||||
name: Test Sample number one
|
||||
version: 0.1
|
||||
steps:
|
||||
- unittest_file:
|
||||
- unittest:
|
||||
name: Unittest item
|
||||
test_file: dummy/unittest_str.py
|
||||
doc: Unittest test
|
||||
@@ -88,7 +88,7 @@ main:
|
||||
name: cycle item
|
||||
iterator : 3
|
||||
steps:
|
||||
- unittest_file:
|
||||
- unittest:
|
||||
name: Unittest item
|
||||
test_file: dummy/dummy.py
|
||||
test_method: test_01_pass
|
||||
@@ -99,7 +99,7 @@ main:
|
||||
name: cycle item
|
||||
iterator : 3
|
||||
steps:
|
||||
- unittest_file:
|
||||
- unittest:
|
||||
name: Unittest item
|
||||
test_file: dummy/dummy.py
|
||||
test_method: test_01_pass
|
||||
|
||||
@@ -75,7 +75,7 @@ a tooltip on the test row.
|
||||
name: Test example
|
||||
steps:
|
||||
|
||||
- unittest_file:
|
||||
- unittest:
|
||||
name: unittest item
|
||||
doc: |
|
||||
The purpose of this unittest test item is to demonstrate
|
||||
@@ -93,4 +93,4 @@ See illustration in :numref:`Figure %s<doc-illustration>`.
|
||||
Unittest
|
||||
^^^^^^^^^
|
||||
|
||||
For ``unittest_file`` type test items, the python docstring of the test method is used as documentation.
|
||||
For ``unittest`` type test items, the python docstring of the test method is used as documentation.
|
||||
|
||||
@@ -10,7 +10,7 @@ This element is of the following form:
|
||||
name: Group Item
|
||||
condition: <| "$(OS)" == "Linux" |>
|
||||
steps:
|
||||
- unittest_file:
|
||||
- unittest:
|
||||
test_file: test_prod_alpha_13.py
|
||||
test_method:
|
||||
...
|
||||
|
||||
@@ -33,7 +33,7 @@ if not provided is given in the table as well.
|
||||
| | | It depends on the test item to take it |
|
||||
| | | into account or not. |
|
||||
| | | For example it makes sense to use it |
|
||||
| | | for ``unittest_file`` test type |
|
||||
| | | for ``unittest`` test type |
|
||||
| | | because it can contain many sub-tests, |
|
||||
| | | but not for sleep test type. |
|
||||
| | | In cycles, it means that the child |
|
||||
|
||||
@@ -12,7 +12,7 @@ This element is of the following form:
|
||||
name: Cycle Temperature
|
||||
iterator: 10
|
||||
steps:
|
||||
- unittest_file:
|
||||
- unittest:
|
||||
test_file: test_prod_rio6_8093.py
|
||||
- py_func:
|
||||
name: function test item
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
**unittest_file** test item
|
||||
**unittest** test item
|
||||
============================================================
|
||||
|
||||
unittest_file test item allows the execution of unittest test script which
|
||||
unittest test item allows the execution of unittest test script which
|
||||
is part of python standard libraries.
|
||||
|
||||
The tum file prototype is as followed:
|
||||
|
||||
.. code-block:: yaml
|
||||
:caption: ``unittest_file`` test item usage example
|
||||
:caption: ``unittest`` test item usage example
|
||||
|
||||
- unittest_file:
|
||||
- unittest:
|
||||
name: unitTest test item
|
||||
test_file: unitTestScript.py
|
||||
test_method:
|
||||
@@ -23,7 +23,7 @@ Beside common test items attributes, unittest test item has specific attribute,
|
||||
|
||||
* ``test_file``: it is the name (and eventually path) of the unittest file
|
||||
to be processed.
|
||||
* ``test_method``: it is an optional unittest_file test sub-item. If one or more
|
||||
* ``test_method``: it is an optional unittest test sub-item. If one or more
|
||||
elements are present, the unittest python script file is parsed and only
|
||||
the corresponding methods are included in the test tree. Otherwise, all
|
||||
the test methods are included in the test tree.
|
||||
@@ -259,7 +259,7 @@ step list attributes.
|
||||
test_items/report_test_item.rst
|
||||
test_items/run_test_item.rst
|
||||
test_items/sleep_test_item.rst
|
||||
test_items/unittest_file_test_item.rst
|
||||
test_items/unittest_test_item.rst
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ class Terminal(Cmd):
|
||||
tree_parent,
|
||||
status_queue)
|
||||
# check for sequence type:
|
||||
if it.item_cmd == cst.TYPE_UNITTEST_FILE.item_cmd:
|
||||
if it.item_cmd == cst.TYPE_UNITTEST.item_cmd:
|
||||
item.setTestDir(test_dir)
|
||||
item.load()
|
||||
elif ((it.item_cmd == cst.TYPE_CYCLE.item_cmd) or
|
||||
|
||||
@@ -96,10 +96,10 @@ class TestItemUnittestElement(TestItem):
|
||||
|
||||
class TestItemUnittestFile(TestItem):
|
||||
def __init__(self, dict_item, parent = None, status_queue=None, filename=""):
|
||||
self._name = cst.TYPE_UNITTEST_FILE.item_name
|
||||
self._name = cst.TYPE_UNITTEST.item_name
|
||||
super().__init__(dict_item, parent, status_queue, filename=filename)
|
||||
self.is_container = True
|
||||
self._type = cst.TYPE_UNITTEST_FILE
|
||||
self._type = cst.TYPE_UNITTEST
|
||||
self._fileName = self._prms.getParam('test_file', required = True, processed = True)
|
||||
self._testDir = ''
|
||||
self._test_methods = self._prms.getParamAll('test_method', processed=True)
|
||||
@@ -161,7 +161,7 @@ class TestItemUnittestFile(TestItem):
|
||||
if self.isStopped():
|
||||
self.result.set(TestValue.NORUN, 'Group execution aborted on user request')
|
||||
else:
|
||||
self.result.set(result.test_result, 'unittest file ' + str(result.test_result))
|
||||
self.result.set(result.test_result, 'unittest ' + str(result.test_result))
|
||||
|
||||
def load(self):
|
||||
ret = {}
|
||||
|
||||
@@ -10,7 +10,7 @@ class ReportExportTxt(rpe.ReportExport):
|
||||
no_value_types = [cst_type.TYPE_CONSOLE.item_name, cst_type.TYPE_SLEEP.item_name,
|
||||
cst_type.TYPE_IMAGE_DLG.item_name, cst_type.TYPE_LET.item_name, cst_type.TYPE_CHECK,
|
||||
cst_type.TYPE_CYCLE.item_name, cst_type.TYPE_GROUP.item_name,
|
||||
cst_type.TYPE_UNITTEST_FILE.item_name, cst_type.TYPE_MESSAGE_DLG.item_name,
|
||||
cst_type.TYPE_UNITTEST.item_name, cst_type.TYPE_MESSAGE_DLG.item_name,
|
||||
cst_type.TYPE_QUESTION_DLG.item_name]
|
||||
|
||||
def __init__(self, name, report_db, report_file, pattern, key, no_header=False):
|
||||
|
||||
@@ -504,7 +504,7 @@ class TestSet:
|
||||
item.is_folded = is_folded
|
||||
child = {}
|
||||
# case where the test item loads itself its descendants
|
||||
if it == cst_type.TYPE_UNITTEST_FILE:
|
||||
if it == cst_type.TYPE_UNITTEST:
|
||||
item.setTestDir(test_dir)
|
||||
child = item.load()
|
||||
elif issubclass(it.item_class, TestItemActions):
|
||||
|
||||
@@ -8,7 +8,7 @@ class TestItemEnum():
|
||||
self.item_class = item_class
|
||||
|
||||
class TestItemType(Enum):
|
||||
TYPE_UNITTEST_FILE = TestItemEnum("unittest_file", "unittest file")
|
||||
TYPE_UNITTEST = TestItemEnum("unittest", "unittest")
|
||||
TYPE_UNITTEST_STEP = TestItemEnum("unittest_step", "unittest step")
|
||||
TYPE_CONSOLE = TestItemEnum("console", "Console")
|
||||
TYPE_CONSOLE_ACTION = TestItemEnum("console_action", "Console action")
|
||||
|
||||
@@ -67,7 +67,7 @@ def _constants_init():
|
||||
cst.TYPE_ROOT.item_class = TestItem
|
||||
cst.TYPE_RUN.item_class = TestItemRun
|
||||
cst.TYPE_SLEEP.item_class = TestItemSleep
|
||||
cst.TYPE_UNITTEST_FILE.item_class = TestItemUnittestFile
|
||||
cst.TYPE_UNITTEST.item_class = TestItemUnittestFile
|
||||
cst.TYPE_VALUE_DLG.item_class = TestItemValueDialog
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ from libs.testium import print_warn
|
||||
# Maps item_name (from TestItemType.item_name) to visual config.
|
||||
# Keys: icon (required), icon_on (optional 2nd state), expanded, unfoldable, no_breakpoint
|
||||
_ITEM_CONFIG = {
|
||||
"unittest file": {"icon": "folder.png", "icon_on": "folder-open.png", "expanded": True, "no_breakpoint": True},
|
||||
"unittest": {"icon": "folder.png", "icon_on": "folder-open.png", "expanded": True, "no_breakpoint": True},
|
||||
"unittest step": {"icon": "document.png", "no_breakpoint": True},
|
||||
"Console": {"icon": "terminal.png", "unfoldable": False},
|
||||
"Console action": {"icon": "terminal.png"},
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
- unittest_file:
|
||||
- unittest:
|
||||
name: Unittest item
|
||||
test_file: {{include_directory}}/unittest.py
|
||||
key: $(test)_PASS
|
||||
test_method: test_01_pass
|
||||
|
||||
- unittest_file:
|
||||
- unittest:
|
||||
name: Unittest item
|
||||
test_file: {{include_directory}}/unittest.py
|
||||
key: $(test)_FAIL
|
||||
|
||||
Reference in New Issue
Block a user