| Total Complexity | 2 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 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 |