Unit test module is an in-build library in python, used to write test scripts . It gives some helpful methods while helps us designing out test in a way , that emulates a real production environment.
While writing test, we need to keep these things in mind
1. Test should start with a clean slate. Meaning the subject under test must not hold any info or be in a state, that might affect the test results.
2. Every tests should test one and only one feature . Clubbing multiple tests in one test, is a bad idea.
Unit test provides some special methods. These can be used to handle the flow of tests as per scenario. Below is a generic template of a unit test showing all methods and their tasks.
While writing test, we need to keep these things in mind
1. Test should start with a clean slate. Meaning the subject under test must not hold any info or be in a state, that might affect the test results.
2. Every tests should test one and only one feature . Clubbing multiple tests in one test, is a bad idea.
Unit test provides some special methods. These can be used to handle the flow of tests as per scenario. Below is a generic template of a unit test showing all methods and their tasks.