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

tests.v0x04.test_controller2switch.test_aggregate_stats   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 TestAggregateStats.setUpClass() 0 11 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A _get_body() 0 3 1
1
"""Aggregate stats request message."""
2
from pyof.v0x04.controller2switch.common import MultipartType
3
from pyof.v0x04.controller2switch.multipart_reply import (
4
    AggregateStatsReply, MultipartReply)
5
from tests.test_struct import TestStruct
6
7
8
class TestAggregateStats(TestStruct):
9
    """Aggregate stats message."""
10
11
    @classmethod
12
    def setUpClass(cls):
13
        """Configure raw file and its object in parent class (TestDump)."""
14
        mp_type = MultipartType.OFPMP_AGGREGATE
15
        super().setUpClass()
16
        super().set_raw_dump_file('v0x04', 'ofpt_aggregate_stats')
17
        super().set_raw_dump_object(MultipartReply, xid=1,
18
                                    multipart_type=mp_type,
19
                                    flags=0,
20
                                    body=_get_body())
21
        super().set_minimum_size(16)
22
23
24
def _get_body():
25
    """Return the body used by MultipartReply message."""
26
    return AggregateStatsReply(packet_count=2, byte_count=220, flow_count=2)
27