Code Duplication    Length = 17-18 lines in 2 locations

tests/unit/models/test_evc_deploy.py 2 locations

@@ 93-110 (lines=18) @@
90
        evc = EVC(**attributes)
91
        self.assertFalse(evc.should_deploy(attributes["primary_links"]))
92
93
    @patch("napps.kytos.mef_eline.models.evc.requests")
94
    def test_send_flow_mods_case1(self, requests_mock):
95
        """Test if you are sending flow_mods."""
96
        flow_mods = {"id": 20}
97
        switch = Mock(spec=Switch, id=1)
98
99
        response = MagicMock()
100
        response.status_code = 201
101
        requests_mock.post.return_value = response
102
103
        # pylint: disable=protected-access
104
        EVC._send_flow_mods(switch, flow_mods)
105
106
        expected_endpoint = f"{MANAGER_URL}/flows/{switch.id}"
107
        expected_data = {"flows": flow_mods}
108
        self.assertEqual(requests_mock.post.call_count, 1)
109
        requests_mock.post.assert_called_once_with(
110
            expected_endpoint, json=expected_data
111
        )
112
113
    @patch("napps.kytos.mef_eline.models.evc.requests")
@@ 113-129 (lines=17) @@
110
            expected_endpoint, json=expected_data
111
        )
112
113
    @patch("napps.kytos.mef_eline.models.evc.requests")
114
    def test_send_flow_mods_case2(self, requests_mock):
115
        """Test if you are sending flow_mods."""
116
        flow_mods = {"id": 20}
117
        switch = Mock(spec=Switch, id=1)
118
        response = MagicMock()
119
        response.status_code = 201
120
        requests_mock.post.return_value = response
121
122
        # pylint: disable=protected-access
123
        EVC._send_flow_mods(switch, flow_mods, command="delete")
124
125
        expected_endpoint = f"{MANAGER_URL}/delete/{switch.id}"
126
        expected_data = {"flows": flow_mods}
127
        self.assertEqual(requests_mock.post.call_count, 1)
128
        requests_mock.post.assert_called_once_with(
129
            expected_endpoint, json=expected_data
130
        )
131
132
    def test_prepare_flow_mod(self):