Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Test files are located in dev-backend/flask_docker/unittests
For now, to run this test:
  1. cd to docker_code and run 'python3 -m unittest -v <path_to_test_file>' (eg. 'python3 -m unittest -v unittests/Sample/model_test.py')
Note: Please run the unit test in the docker container: under www/var (reference: Dev/Debug in Container)
Otherwise, you will need to install all dependencies in your local env.
 


User model/api test functions

Doc
model_test.py/test_user_createtest if a user can be created correctly
model_test.py/create_userhelper function to create a user
model_test.py/test_generate_password_hashtest if a password hash can be generate correctly
model_test.py/test_check_password_hashtest if the password checking working properly
api_test.py/test_app_is_testingtest if the app is running in TEST mode
api_test.py/registerhelper function to register a new user by API
api_test.py/test_registertest if a user can be registered correctly via register API
api_test.py/test_logintest if a user can logged in with credentials via log in API
api_test.py/test_logouttest if a user can logout via log out API


Sample model/api test functionsDoc
model_test.py/test_sample_createtest if a sample instance can be created
model_test.py/test_app_is_testingtest if the app is running in TEST mode
model_test.py/test_get_sample_apitest if we can get all samples data correctly via get sample list API
model_test.py/test_post_sample_apitest if we can upload a sample data via add sample API
model_test.py/test_get_sample_by_infant_id_apitest if we can get all samples data of a specific infant via get sample by infant id API