Unit Testing vs Integration Testing
- Unit Testing:
- This a type of software testing where small unit of code is tested.
- The small unit of code is generally an individual function or class or module.
- Unit Tests are performed by Developers
- Integration Testing:
- This is the process of testing the interface between two software units or components.
- This is focused on determining the correctness of the Interface.
- In our microservices, the integration with individual service is using REST API
- Lets make changes to copy the test db for every test invocation.
- Create a constants file with database names
- make changes in the app.py the include the database path while creating flask application
- Add the copy empty database to temp location in fixture and add the new db location while create test_client for flask app.
- Refer Here for the changes done
- Refer Here for the changes made to check the specific items
- Exercise: Now create a test for the catalog brand where you perform all the steps as done it test_catalogbrand, ensure you create reusable code.