Passed
Push — master ( 4940e6...c07b6a )
by Humberto
02:16
created

TestVendorHeader.setUpClass()   A

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nop 1
1
"""Testing VendorHeader message."""
2
from pyof.v0x01.symmetric.vendor_header import VendorHeader
3
from tests.unit.test_struct import TestStruct
4
5
6
class TestVendorHeader(TestStruct):
7
    """Vendor message tests (also those in :class:`.TestDump`)."""
8
9
    @classmethod
10
    def setUpClass(cls):
11
        super().set_minimum_size(8)
12
13
    def test_unpack(self):
14
        """Test unpack VendorHeader message."""
15
        message = b'My custom vendor extra data.'
16
        vendor_header = VendorHeader(xid=4, vendor=128,
17
                                     data=message)
18
        data = b'\x01\x04\x00(\x00\x00\x00\x04\x00\x00\x00\x80' + message
19
        self._test_unpack(vendor_header, bytes2unpack=data)
20