Passed
Pull Request — master (#47)
by Vinicius
08:26 queued 02:22
created

build.tests.unit.test_main.TestMain.get_napp_urls()   A

Complexity

Conditions 4

Size

Total Lines 24
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 4
eloc 12
nop 1
dl 0
loc 24
rs 9.8
c 0
b 0
f 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