diff --git a/doc/examples/dummy/cpt/endurance.tum b/doc/examples/dummy/cpt/endurance.tum index 37d1709..26acbd0 100644 --- a/doc/examples/dummy/cpt/endurance.tum +++ b/doc/examples/dummy/cpt/endurance.tum @@ -1,4 +1,4 @@ - - unittest_file: + - unittest: name: Test 5 test_file: dummy.py diff --git a/doc/examples/dummy/cpt/temperature.tum b/doc/examples/dummy/cpt/temperature.tum index ad47ee6..cc671ea 100644 --- a/doc/examples/dummy/cpt/temperature.tum +++ b/doc/examples/dummy/cpt/temperature.tum @@ -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 diff --git a/doc/examples/dummy/dummy.tum b/doc/examples/dummy/dummy.tum index 391ec02..520b1ba 100644 --- a/doc/examples/dummy/dummy.tum +++ b/doc/examples/dummy/dummy.tum @@ -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 diff --git a/doc/examples/example_cycle.tum b/doc/examples/example_cycle.tum index 6d068ae..66d6988 100644 --- a/doc/examples/example_cycle.tum +++ b/doc/examples/example_cycle.tum @@ -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 diff --git a/doc/examples/example_items.tum b/doc/examples/example_items.tum index a2aebcc..b47036f 100644 --- a/doc/examples/example_items.tum +++ b/doc/examples/example_items.tum @@ -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 diff --git a/doc/manual/sphinx/source/other_features.rst b/doc/manual/sphinx/source/other_features.rst index 9647279..5365194 100644 --- a/doc/manual/sphinx/source/other_features.rst +++ b/doc/manual/sphinx/source/other_features.rst @@ -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`. 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. diff --git a/doc/manual/sphinx/source/test_items/group_test_item.rst b/doc/manual/sphinx/source/test_items/group_test_item.rst index 3af307d..7945f69 100644 --- a/doc/manual/sphinx/source/test_items/group_test_item.rst +++ b/doc/manual/sphinx/source/test_items/group_test_item.rst @@ -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: ... diff --git a/doc/manual/sphinx/source/test_items/items_common_attributes.rst b/doc/manual/sphinx/source/test_items/items_common_attributes.rst index 32c3df3..f2e78fc 100644 --- a/doc/manual/sphinx/source/test_items/items_common_attributes.rst +++ b/doc/manual/sphinx/source/test_items/items_common_attributes.rst @@ -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 | diff --git a/doc/manual/sphinx/source/test_items/loop_test_item.rst b/doc/manual/sphinx/source/test_items/loop_test_item.rst index b2cea19..ae25325 100644 --- a/doc/manual/sphinx/source/test_items/loop_test_item.rst +++ b/doc/manual/sphinx/source/test_items/loop_test_item.rst @@ -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 diff --git a/doc/manual/sphinx/source/test_items/unittest_file_test_item.rst b/doc/manual/sphinx/source/test_items/unittest_test_item.rst similarity index 89% rename from doc/manual/sphinx/source/test_items/unittest_file_test_item.rst rename to doc/manual/sphinx/source/test_items/unittest_test_item.rst index 43dd10d..5f4e708 100644 --- a/doc/manual/sphinx/source/test_items/unittest_file_test_item.rst +++ b/doc/manual/sphinx/source/test_items/unittest_test_item.rst @@ -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. @@ -78,4 +78,4 @@ Here is an example how to use the console module from python ``unittest``. @classmethod def tearDownClass(cls): - cls.consA0.close() \ No newline at end of file + cls.consA0.close() diff --git a/doc/manual/sphinx/source/tum_syntax.rst b/doc/manual/sphinx/source/tum_syntax.rst index ce204a3..2b4403d 100644 --- a/doc/manual/sphinx/source/tum_syntax.rst +++ b/doc/manual/sphinx/source/tum_syntax.rst @@ -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 diff --git a/src/testium/interpreter/terminal.py b/src/testium/interpreter/terminal.py index 1910ecb..87bc44b 100644 --- a/src/testium/interpreter/terminal.py +++ b/src/testium/interpreter/terminal.py @@ -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 diff --git a/src/testium/interpreter/test_items/test_item_unittest.py b/src/testium/interpreter/test_items/test_item_unittest.py index a3226cd..b6b5e29 100644 --- a/src/testium/interpreter/test_items/test_item_unittest.py +++ b/src/testium/interpreter/test_items/test_item_unittest.py @@ -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 = {} diff --git a/src/testium/interpreter/test_report/report_export_txt.py b/src/testium/interpreter/test_report/report_export_txt.py index d2858c5..87721ca 100644 --- a/src/testium/interpreter/test_report/report_export_txt.py +++ b/src/testium/interpreter/test_report/report_export_txt.py @@ -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): diff --git a/src/testium/interpreter/test_set.py b/src/testium/interpreter/test_set.py index 93ae79a..785f846 100644 --- a/src/testium/interpreter/test_set.py +++ b/src/testium/interpreter/test_set.py @@ -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): diff --git a/src/testium/interpreter/utils/constants.py b/src/testium/interpreter/utils/constants.py index 132f28d..221df9d 100644 --- a/src/testium/interpreter/utils/constants.py +++ b/src/testium/interpreter/utils/constants.py @@ -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") diff --git a/src/testium/interpreter/utils/test_init.py b/src/testium/interpreter/utils/test_init.py index 0d77a02..d5b3267 100644 --- a/src/testium/interpreter/utils/test_init.py +++ b/src/testium/interpreter/utils/test_init.py @@ -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 diff --git a/src/testium/main_win/test_tree_items/test_tree_item.py b/src/testium/main_win/test_tree_items/test_tree_item.py index 07b2a37..0ec0412 100644 --- a/src/testium/main_win/test_tree_items/test_tree_item.py +++ b/src/testium/main_win/test_tree_items/test_tree_item.py @@ -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"}, diff --git a/test/validation/items/unittest/test.tum b/test/validation/items/unittest/test.tum index b376d77..6b2ca7f 100644 --- a/test/validation/items/unittest/test.tum +++ b/test/validation/items/unittest/test.tum @@ -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