Passed
Pull Request — master (#577)
by Gleyberson
02:14
created

tests.v0x04.test_controller2switch.test_aggregate_stats_request   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 18
dl 0
loc 27
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A TestAggregateStatsRequest.setUpClass() 0 10 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A _get_body() 0 3 1
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.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