Passed
Push — master ( b50e97...feedcb )
by Humberto
01:28 queued 14s
created

_get_body()   A

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nop 0
1
"""Aggregate stats request message."""
2
from pyof.v0x04.common.flow_match import Match
3
from pyof.v0x04.controller2switch.common import MultipartType
4
from pyof.v0x04.controller2switch.multipart_request import (
5
    AggregateStatsRequest, MultipartRequest)
6
from tests.unit.test_struct import TestStruct
7
8
9
class TestAggregateStatsRequest(TestStruct):
10
    """Aggregate stats request message."""
11
12
    @classmethod
13
    def setUpClass(cls):
14
        """Configure raw file and its object in parent class (TestDump)."""
15
        mp_type = MultipartType.OFPMP_AGGREGATE
16
        super().setUpClass()
17
        super().set_raw_dump_file('v0x04', 'ofpt_aggregate_stats_request')
18
        super().set_raw_dump_object(MultipartRequest, xid=1,
19
                                    multipart_type=mp_type,
20
                                    flags=0, body=_get_body())
21
        super().set_minimum_size(16)
22
23
24
def _get_body():
25
    """Return the body used by MultipartRequest message."""
26
    return AggregateStatsRequest(match=Match())
27