build.tests.conftest.switch_two()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nop 0
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
"""Conftest."""
2 1
from unittest.mock import MagicMock
3
4 1
import pytest
5 1
from kytos.lib.helpers import get_interface_mock, get_switch_mock
6
7 1
from napps.kytos.of_lldp.controllers import LivenessController
8 1
from napps.kytos.of_lldp.managers.liveness import ILSM, LSM, LivenessManager
9
10
11 1
@pytest.fixture
12 1
def ilsm() -> None:
13
    """ISLM fixture."""
14 1
    return ILSM()
15
16
17 1
@pytest.fixture
18 1
def lsm() -> None:
19
    """LSM fixture."""
20 1
    return LSM(ILSM(), ILSM())
21
22
23 1
@pytest.fixture
24 1
def switch_one():
25
    """Switch one fixture."""
26 1
    return get_switch_mock("00:00:00:00:00:00:00:01", 0x04)
27
28
29 1
@pytest.fixture
30 1
def switch_two():
31
    """Switch one fixture."""
32 1
    return get_switch_mock("00:00:00:00:00:00:00:02", 0x04)
33
34
35 1
@pytest.fixture
36 1
def intf_one(switch_one):
37
    """Interface one fixture."""
38 1
    return get_interface_mock("s1-eth1", 1, switch_one)
39
40
41 1
@pytest.fixture
42 1
def intf_two(switch_two):
43
    """Interface two fixture."""
44 1
    return get_interface_mock("s2-eth1", 1, switch_two)
45
46
47 1
@pytest.fixture
48 1
def intf_three(switch_two):
49
    """Interface three fixture."""
50 1
    return get_interface_mock("s2-eth2", 2, switch_two)
51
52
53 1
@pytest.fixture
54 1
def liveness_manager():
55
    """LivenessManager fixture."""
56 1
    settings = MagicMock()
57 1
    settings.LIVENESS_MIN_HELLOS_UP = 1
58 1
    return LivenessManager(MagicMock(), settings)
59
60
61 1
@pytest.fixture
62 1
def liveness_controller() -> None:
63
    """LivenessController."""
64
    return LivenessController(MagicMock())
65