Skip to content
This repository was archived by the owner on Apr 22, 2024. It is now read-only.

Commit a290bd9

Browse files
gleybersonandradehdiogenes
authored andcommitted
Fix informational code issues
Some informational code issues were introduced in PR #577, this fixes these issues.
1 parent 6758860 commit a290bd9

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed
Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,42 @@
11
"""FlowMod test."""
2-
from pyof.v0x04.common.flow_instructions import InstructionApplyAction, InstructionType, ListOfInstruction
2+
from pyof.v0x04.common.action import ActionOutput, ListOfActions
3+
from pyof.v0x04.common.flow_instructions import (
4+
InstructionApplyAction, ListOfInstruction)
35
from pyof.v0x04.common.flow_match import (
46
Match, MatchType, OxmClass, OxmOfbMatchField, OxmTLV)
5-
from pyof.v0x04.controller2switch.flow_mod import FlowMod, FlowModCommand
6-
from pyof.v0x04.common.action import ActionOutput, ListOfActions
77
from pyof.v0x04.common.port import PortNo
8+
from pyof.v0x04.controller2switch.flow_mod import FlowMod, FlowModCommand
89
from tests.test_struct import TestStruct
910

11+
1012
class TestFlowMod(TestStruct):
1113
"""FlowMod test."""
1214

1315
def test_min_size(self):
1416
"""Test struct minimum size."""
1517
super().set_raw_dump_file('v0x04', 'ofpt_flow_mod')
1618
super().set_raw_dump_object(FlowMod, xid=2219910763,
17-
command=FlowModCommand.OFPFC_ADD,
18-
priority = 1000,
19-
match = _new_match(),
20-
instructions = _new_list_of_instructions())
19+
command=FlowModCommand.OFPFC_ADD,
20+
priority=1000,
21+
match=_new_match(),
22+
instructions=_new_list_of_instructions())
2123
super().set_minimum_size(56)
2224

2325

2426
def _new_match():
2527
"""Crate new Match instance."""
26-
oxmtlv1 = OxmTLV(oxm_class=OxmClass.OFPXMC_OPENFLOW_BASIC,
27-
oxm_field=OxmOfbMatchField.OFPXMT_OFB_ETH_TYPE,
28-
oxm_hasmask=False, oxm_value=b'\x88\xcc')
29-
oxmtlv2 = OxmTLV(oxm_class=OxmClass.OFPXMC_OPENFLOW_BASIC,
30-
oxm_field=OxmOfbMatchField.OFPXMT_OFB_VLAN_VID,
31-
oxm_hasmask=False, oxm_value=b'\x1e\xd7')
28+
oxm_tlv1 = OxmTLV(oxm_class=OxmClass.OFPXMC_OPENFLOW_BASIC,
29+
oxm_field=OxmOfbMatchField.OFPXMT_OFB_ETH_TYPE,
30+
oxm_hasmask=False, oxm_value=b'\x88\xcc')
31+
oxmt_lv2 = OxmTLV(oxm_class=OxmClass.OFPXMC_OPENFLOW_BASIC,
32+
oxm_field=OxmOfbMatchField.OFPXMT_OFB_VLAN_VID,
33+
oxm_hasmask=False, oxm_value=b'\x1e\xd7')
3234
return Match(match_type=MatchType.OFPMT_OXM,
33-
oxm_match_fields=[oxmtlv1, oxmtlv2])
35+
oxm_match_fields=[oxm_tlv1, oxmt_lv2])
3436

3537
def _new_list_of_instructions():
3638
"""Crate new ListOfInstruction."""
37-
ao = ActionOutput(port=PortNo.OFPP_CONTROLLER)
38-
loa = ListOfActions([ao])
39+
output = ActionOutput(port=PortNo.OFPP_CONTROLLER)
40+
loa = ListOfActions([output])
3941
instruction = InstructionApplyAction(loa)
4042
return ListOfInstruction([instruction])

0 commit comments

Comments
 (0)