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

TestErrorMessage.setUpClass()   A

Complexity

Conditions 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 10
c 1
b 0
f 0
rs 9.4285
cc 1
1
"""Testing Error Message."""
2
from pyof.v0x01.asynchronous.error_msg import (
3
    BadRequestCode, ErrorMsg, ErrorType, FlowModFailedCode)
4
from tests.test_struct import TestMsgDump, TestMsgDumpFile
5
6
7
class TestErrorMessageFromFile(TestMsgDumpFile):
8
    """Test the ErrorMsg class."""
9
10
    dumpfile = 'v0x01/ofpt_error_msg.dat'
11
    obj = ErrorMsg(xid=12,
12
                   error_type=ErrorType.OFPET_BAD_REQUEST,
13
                   code=BadRequestCode.OFPBRC_BAD_STAT,
14
                   data=b'')
15
    min_size = 12
16
17
18
class TestErrorMessageDump(TestMsgDump):
19
    """Test the ErrorMsg class."""
20
21
    # dump needs to be checked
22
    dump = b'\x01\x01\x00\x10\x00\x00\x00\x18\x00\x03\x00\x02FLOW'
23
    obj = ErrorMsg(xid=24,
24
                   error_type=ErrorType.OFPET_FLOW_MOD_FAILED,
25
                   code=FlowModFailedCode.OFPFMFC_EPERM,
26
                   data=b'FLOW')
27
    min_size = 12
28