Testing¶
Pytest is the test framework adopted in this project.
All the tests can be found in the tests/ folder.
To enable Pytest in Pycharm, please see Enable Pytest in Pycharm.
For developers, if you want to write more tests, please follow the Pytest naming convention
Unit tests¶
Functional testing¶
-
test_functionalities.test_create_project(delete_project_after)¶ Test if a workflow project can be successfully created
-
test_functionalities.test_create_existing_project(delete_project_after)¶ given a existing project name, When creating an existing project, should raise exception if the project already exists
Integration testing¶
Below are the tests for testing the example workflow and its components
-
test_example_workflow.test_pretend_import()¶ given a project with the pretend_import script imported as the 1st script, when I run the project with the pretend_data.txt as input, should see pretend_data.txt passed into the 1st workspace :return: :rtype:
-
test_example_workflow.test_pretend_segment()¶ given a project with the pretend_segment script imported as the 2nd script (depends on pretend_import), when I run the project, should see pointcloud.txt in the 2nd workspace
-
test_example_workflow.test_pretend_fit()¶ given a project with the pretend_fit script imported as the 3rd script (depends on pretend_segment), when I run the project, should see mesh.txt in the 3rd workspace :return: :rtype:
-
test_example_workflow.test_pretend_mechanics()¶ given a project with the pretend_mechanics1 and pretend_mechanics2 scripts imported as the 4th and 5th scripts (both depend on pretend_fit and will be run right after the completion of pretend_fit in a random order), when I run the project, should see solution1.txt in the 4th/5th workspace and solution2.txt in the 4th/5th workspace.
-
test_example_workflow.test_pretend_send()¶ given a project with the pretend_send script imported as the 6th script (depends on pretend_mechanics1 and pretend_mechanics2. i.e. pretend_send will be executed twice after pretend_mechanics1 and pretend_mechanics2 separately), when I run the project, should see solution1.txt and solution2.txt sent to a destination folder