kytos-ng / sdntrace_cp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve test coverage on `main.py`

Ktmi opened this issue · comments

Currently unit tests on main.py only reach 70% code coverage. While not a huge problem, as the sections not covered by unit tests are still covered by the end to end tests, it would still be nice to have additional tests to complete coverage on main.py, as they could provide insight to issues caused by future changes.

Currently the following methods need additional testing:

  • do_match
  • match_flows
  • match_and_apply

I worked on some new unit tests in PR #62 and now the coverage is 91% on main.py:

Name           Stmts   Miss  Cover   Missing
--------------------------------------------
__init__.py        0      0   100%
automate.py      144      9    94%   40, 53-54, 60, 89-90, 134-135, 220
main.py          149     14    91%   55-56, 103, 126, 180, 187-192, 212, 216-217, 242
scheduler.py      18      1    94%   39
settings.py       11      0   100%
utils.py          98      5    95%   12-15, 122
--------------------------------------------
TOTAL            420     29    93%

Since we still have room to improve, I will keep this issue open.