You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are the beginnings of a unittest structure in tests/test_openupgradelib.py
The goal is to increase coverage and guarantee code stability of functions in openupgradelib by:
running each function
mocking a openerp installation, database, modules
checking the calls run on the mocks
having a mock database built in travis or in setup
checking that openupgradelib correctly manipulates the data
Things to avoid:
Implementation tests. This means testing a whole migration at once. A unittest is supposed to test by units. Implementation testing for whole migrations should be done in https://github.com/OCA/openupgrade
Using mock to give out the expected answer. Mock should take care of the background details. We don't want to be testing the mock object, we want to test the calls.
Testing the best cases. Test edge cases. Example: single id, duplicate ids, no ids, unicode instead of str, None as a parameter.
Testing version specific migrations. As said in 1. these scripts should be seen as version agnostic and must be usable for all migrations including non-major migrations.
The text was updated successfully, but these errors were encountered:
bwrsandman
changed the title
Add unittests for functions in openupgradelib/openupgrade.py
[Medium Constribution] Add unittests for functions in openupgradelib/openupgrade.py
Aug 13, 2015
There are the beginnings of a unittest structure in
tests/test_openupgradelib.py
The goal is to increase coverage and guarantee code stability of functions in openupgradelib by:
Things to avoid:
The text was updated successfully, but these errors were encountered: