Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Italo Valcy committed Aug 15, 2022
1 parent 2f45cd5 commit 9660a8e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tests/unit/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,11 @@ def test_flow_stats(self, mock_match_flows):
def _patch_switch_flow(self, flow_id):
"""Helper method to patch controller to return switch/flow data."""
# patching the flow_stats object in the switch
self.napp.controller.switches = MagicMock()
flow = self._get_mocked_flow_stats()
flow.id = flow_id
switch = MagicMock()
switch.generic_flows = [flow]
self.napp.controller.switches.values.return_value = [switch]
self.napp.controller.switches = {"1": switch}
self.napp.controller.get_switch_by_dpid = MagicMock()
self.napp.controller.get_switch_by_dpid.return_value = switch

Expand Down

0 comments on commit 9660a8e

Please sign in to comment.