Run tests locally
We use Flake8 for linting and PyTest for testing.
Lint
The Flake8 configuration is inside the .flake8
file.
The project is configured only for linting python code from the Connector/
and scripts/
directories.
You can lint with the following command:
$ flake8 --statistics
As optional, you can create a GitHub Hook to automatically check that your code follows the linting rules before committing your changes.
Lint automatically with hooksLocal testing
You can do the local testing manually:
Lint the project using the instructions above.
Use the
scripts/nodechain.py
script to launch NodeChain in regtest network locally and select the token you want to test.Run tests inside the Connector docker container with the following command.
$ docker exec -it ${TOKEN}_regtest_api_connector_1 bash -c "cd Connector && python -m pytest -c tests/${TOKEN}/pytest_${TOKEN}.ini -s --cov=${TOKEN}/ --cov=logger/ --cov=rpcutils/ --cov=wsutils/ tests/${TOKEN}"
Last updated