For testing out various CI tools, we have made a simple Python web application suing flask framework. The application is available freely at Github. This web application returns the IP address of the client.
Check out the code below:
We will use this application to setup continuous integration. We have written a unit test using Python unittest library and a functionality test.
The unit test checks for the response code of /get_my_ip.
The functionality test checks the actual json string for the local IP.
Order of execution for the CI would be:
Check out the code below:
We will use this application to setup continuous integration. We have written a unit test using Python unittest library and a functionality test.
The unit test checks for the response code of /get_my_ip.
The functionality test checks the actual json string for the local IP.
Order of execution for the CI would be:
- Start flask server in background.
- Sleep for one second to give flask time to start the application properly.
- Execute unit test.
- Execute functional test.