172 | | {{{ |
173 | | python web2py.py -S eden -M -R applications/eden/tests/unit_tests/modules/s3/s3aaa.py |
174 | | python web2py.py -S eden -M -R applications/eden/tests/unit_tests/modules/s3/s3rest.py |
175 | | }}} |
176 | | |
| 172 | |
| 173 | To run all unit tests: |
| 174 | {{{ |
| 175 | python web2py.py -S eden -M -R applications/eden/modules/unit_tests/suite.py |
| 176 | }}} |
| 177 | |
| 178 | These unit tests are meant to detect problems early during development, which means you should run them quite often while you're still working on the code (read: before and after every little change you make) rather than expecting them to be run during QA cycles. That again means you would more often need to run tests for particular modules than the whole suite. |
| 179 | |
| 180 | To run tests for particular modules: |
| 181 | {{{ |
| 182 | python web2py.py -S eden -M -R applications/eden/modules/unit_tests/s3/s3resource.py |
| 183 | python web2py.py -S eden -M -R applications/eden/modules/unit_tests/eden/pr.py |
| 184 | }}} |
| 185 | |
| 186 | To first implement unit test cases for the functionality you intend to implement before actually implementing it can be a very powerful development strategy especially for back-end APIs. Apart from preventing bugs, this helps you to validate your design against requirements, and to keep the implementation simple and focussed. Additionally, the test cases can be a rich source of code samples how to apply your API methods. |