Passed
Push — master ( 127cfb...14f54d )
by Vinicius
02:06 queued 12s
created

build.tests.conftest   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 63
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 33
dl 0
loc 63
rs 10
c 0
b 0
f 0
wmc 9

9 Functions

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