Mentions légales du service

Skip to content

Adding a new unit test (on Round class)

BOUILLARD Yannick requested to merge feature/214-additional-unit-tests into develop

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):

  1. if default log level is too high, some test will fail
  2. how to define Fake Classes (the way it is done in the file, or declare those into the setUpClass method?
  3. Agree on how to define side_effect function when doing performing unit tests either :
def side_effect_fct(arg1, arg2):


def side_effect_fct(*args, **kwargs):

(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:

  1. better catch /filter exceptions, as discussed and summarized in file (currently, all exceptions are caught using except Exception)
  2. 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) )
Edited by BOUILLARD Yannick

Merge request reports