| Total Complexity | 2 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Coverage | 57.14% |
| Changes | 0 | ||
| 1 | """Module to test the main napp file.""" |
||
| 2 | 1 | from unittest.mock import patch |
|
| 3 | |||
| 4 | 1 | from kytos.lib.helpers import get_controller_mock |
|
| 5 | |||
| 6 | |||
| 7 | # pylint: disable=too-many-public-methods, too-many-lines |
||
| 8 | 1 | class TestMain: |
|
| 9 | """Test the Main class.""" |
||
| 10 | |||
| 11 | 1 | def setup_method(self): |
|
| 12 | """Execute steps before each tests.""" |
||
| 13 | |||
| 14 | # The decorator run_on_thread is patched, so methods that listen |
||
| 15 | # for events do not run on threads while tested. |
||
| 16 | # Decorators have to be patched before the methods that are |
||
| 17 | # decorated with them are imported. |
||
| 18 | patch("kytos.core.helpers.run_on_thread", lambda x: x).start() |
||
| 19 | # pylint: disable=import-outside-toplevel |
||
| 20 | from napps.amlight.sdntrace.main import Main |
||
| 21 | |||
| 22 | self.napp = Main(get_controller_mock()) |
||
| 23 |