Adding a new unit test (on Round class)
This MR contains a new unit test file, on the Round class (node side).
It proposes also a fake_classes
repository in which to store dummy classes for unit testing
Issues with this unit test (I will update if needed):
- if default log level is too high, some test will fail
- how to define Fake Classes (the way it is done in the file, or declare those into the
setUpClass
method? - Agree on how to define side_effect function when doing performing unit tests either :
def side_effect_fct(arg1, arg2):
pass
or
def side_effect_fct(*args, **kwargs):
pass
(2nd solution is more robust to API changes)
4. decide how to patch functions/methods calls (using context manager, decorators, or patcher.start()
methods.
Issues found in class Round when writing unit test:
- better catch /filter exceptions, as discussed and summarized in
CODING_RULES.md
file (currently, all exceptions are caught usingexcept Exception
) - Some exceptions are still not caught (eg
NodeMessages.reply_create().get_dict()
) (need to update unit tests if exceptions are caught afterward - see user story #212 (closed) )