-
Notifications
You must be signed in to change notification settings - Fork 5
Test Structure
NESi´s test framework is pytest.
Because of NESi´s API Server and client structure the normal testing method of pytest is not possible. Therefore the testing behaviour of NESi is integrated into the project´s architecture.
Tests can be started with the following command structure:
% ./bootup/restapi.sh --test-alcatel-commands
For other vendors replace 'alcatel' with your desired vendor, or use:
% ./bootup/restapi.sh --help
At the beginning of the tests the API boots up and the CLI will start to receive test inputs from pytest. Therefore the CLI starts pytest.main with vendor-specific arguments. Both test types, unit and integration tests, are included.
You can find the complete test structure in the test_cases directory. The entry point of all test are the test_core and the vendor specific tests can be found in the corresponding folders.
To create a new test for a specific vendor, the Testcore class must be extended to work with the api model. Furthermore the test functions must start with test_.
For more informations about writing test please take a look at TestAlcatel.
- The "unit tests" are used to test the databasemodel itself
- The "integration test" are used to test the correct implementation of the commands
The integration tests use .txt files with commands as I/O streams of the cli.
For every push on our master branch the tests for every vendor start automatically in a seperate workflow. Test badges are linked in the README.md.