Passed
Pull Request — master (#404)
by
unknown
01:53
created

TestPacketQueue.setUp()   A

Complexity

Conditions 1

Size

Total Lines 5

Duplication

Lines 5
Ratio 100 %

Importance

Changes 0
Metric Value
dl 5
loc 5
c 0
b 0
f 0
rs 9.4285
cc 1
1
"""Testing Queue structure."""
2
from pyof.v0x01.common import queue
3
from tests.test_struct import TestStructDump
4
5
6
class TestQueuePropHeader(TestStructDump):
7
    """Test QueuePropHeader."""
8
9
    dump = b'\x00\x01\x00\x0c\x00\x00\x00\x00'  # needs to be checked
10
    obj = queue.QueuePropHeader(
11
        queue_property=queue.QueueProperties.OFPQT_MIN_RATE,
12
        length=12)
13
14
15
class TestPacketQueue(TestStructDump):
16
    """TestPacketQueue."""
17
18
    dump = b'\x00\x00\x00\x01\x00\x08\x00\x00'  # needs to be checked
19
    obj = queue.PacketQueue(queue_id=1,
20
                            length=8)
21
22
23
class TestQueuePropMinRate(TestStructDump):
24
    """Test QueuePropMinRate."""
25
26
    dump = b'\x00\x01\x00\x10\x00\x00\x00\x00\x03\xe8\x00\x00'
27
    dump += b'\x00\x00\x00\x00'  # needs to be checked
28
    obj = queue.QueuePropMinRate(rate=1000)
29