freeleaps-service-hub/apps/notification/tests/integration_tests
2025-08-14 21:11:58 +08:00
..
README.md test(api): test the api interfaces cao work 2025-08-14 21:11:58 +08:00
test_email_sender_real.py test(api): test the api interfaces cao work 2025-08-14 21:11:58 +08:00
test_template_message_real.py test(api): test the api interfaces cao work 2025-08-14 21:11:58 +08:00
test_tenant_notification_real.py test(api): test the api interfaces cao work 2025-08-14 21:11:58 +08:00

api-test

# run the command

cd notification
source local.env
python webapi/main.py &

After running the commands, the notification api will start

create the data of template message and email senders in mongodb

test the interfaces under webapi/routes/template_message.py & email_sender.py

can comment and uncomment some lines in async def run_all_tests(self) to test certain interfaces

# run the command
cd tests/integration_tests
export PYTHONPATH="/yourpath/freeleaps-service-hub/apps/notification
source ../../local.env 
python test_email_sender_real.py 
python test_template_message_real.py

After running the commands, the template message and email sender will stored in the mongodb

Based on the template message and email sender, test the interfaces under webapi/routes/

tenant_notification.py

can comment and uncomment some lines in async def run_all_tests(self) to test certain interfaces

test_recipient_emails can be set as the true email addresses

# run the command
python test_tenant_notification_real.py