Test Failed
Pull Request — master (#404)
by
unknown
01:18
created

TestPhyPort.setUp()   A

Complexity

Conditions 1

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
c 0
b 0
f 0
rs 9.4285
cc 1
1
"""Testing PhyPort structure."""
2
from pyof.foundation.constants import OFP_MAX_PORT_NAME_LEN
3
from pyof.v0x01.common.phy_port import (
4
    PhyPort, PortConfig, PortFeatures, PortState)
5
from tests.test_struct import TestStructDump
6
7
8
class TestPhyPort(TestStructDump):
9
    """Test PhyPort class."""
10
11
    dump = b'\x00\x02\x1a+<M^oXXXXXXXXXXXXXXX\x00\x00\x00\x00\x02\x00\x00\x02'
12
    dump += b'\x00\x00\x00\x00@\x00\x00\x04\x00\x00\x00\x02\x00\x00\x00\x02'
13
    dump += b'\x00'
14
15
    obj = PhyPort(port_no=2,
16
                  hw_addr='1a:2b:3c:4d:5e:6f',
17
                  name='X' * OFP_MAX_PORT_NAME_LEN,
18
                  config=PortConfig.OFPPC_NO_STP,
19
                  state=PortState.OFPPS_STP_FORWARD,
20
                  curr=PortFeatures.OFPPF_10GB_FD,
21
                  advertised=PortFeatures.OFPPF_PAUSE,
22
                  supported=PortFeatures.OFPPF_AUTONEG,
23
                  peer=PortFeatures.OFPPF_AUTONEG)
24