diff --git a/apps/notification/tests/README.md b/apps/notification/tests/README.md new file mode 100644 index 0000000..c534c63 --- /dev/null +++ b/apps/notification/tests/README.md @@ -0,0 +1,32 @@ +## unittest +```shell +# run the command + +cd test/unit_test +python -m pytest unit_test_file.py -v --cov=backend.tested_directory --cov-report=html +``` +After the test is completed, a htmlcov folder will be generated. The test result is in the htmlcov/index.html. + +## integration test +```shell +# run the command + +cd test/integration_test +python -m pytest integration_test_file.py -v -s --html=report.html --self-contained-html --asyncio-mode=auto + +``` +After the test is completed, a report.html will be generated. The test result is in the file. +```shell +python integration_test_file.py +python -m coverage html --include="../../backend/tested_directory/*" +``` +After the test is completed, a htmlcov folder will be generated. The test result is in the htmlcov/index.html. + + +## Q & A +### Q: ModuleNotFoundError: No module named 'backend' +```shell +# export freeleaps code path + +export PYTHONPATH="/yourpath/freeleaps-service-hub/apps/notification" +``` \ No newline at end of file