Code Duplication    Length = 12-12 lines in 2 locations

tests/test_main.py 2 locations

@@ 249-260 (lines=12) @@
246
        expected_result = circuits['1']
247
        self.assertEqual(json.loads(response.data), expected_result)
248
249
    @patch('napps.kytos.mef_eline.storehouse.StoreHouse.get_data')
250
    def test_circuit_with_invalid_id(self, storehouse_data_mock):
251
        """Test if get_circuit return invalid circuit_id."""
252
        circuits = {'1': {'name': 'circuit_1'},
253
                    '2': {'name': 'circuit_2'}}
254
        storehouse_data_mock.return_value = circuits
255
256
        api = self.get_app_test_client(self.napp)
257
        url = f'{self.server_name_url}/v2/evc/3'
258
        response = api.get(url)
259
        expected_result = {'response': 'circuit_id 3 not found'}
260
        self.assertEqual(json.loads(response.data), expected_result)
261
262
    @patch('napps.kytos.mef_eline.storehouse.StoreHouse.get_data')
263
    @patch('napps.kytos.mef_eline.scheduler.Scheduler.add')
@@ 236-247 (lines=12) @@
233
        expected_result = circuits
234
        self.assertEqual(json.loads(response.data), expected_result)
235
236
    @patch('napps.kytos.mef_eline.storehouse.StoreHouse.get_data')
237
    def test_circuit_with_valid_id(self, storehouse_data_mock):
238
        """Test if get_circuit return the circuit attributes."""
239
        circuits = {'1': {'name': 'circuit_1'},
240
                    '2': {'name': 'circuit_2'}}
241
        storehouse_data_mock.return_value = circuits
242
243
        api = self.get_app_test_client(self.napp)
244
        url = f'{self.server_name_url}/v2/evc/1'
245
        response = api.get(url)
246
        expected_result = circuits['1']
247
        self.assertEqual(json.loads(response.data), expected_result)
248
249
    @patch('napps.kytos.mef_eline.storehouse.StoreHouse.get_data')
250
    def test_circuit_with_invalid_id(self, storehouse_data_mock):