| @@ 342-355 (lines=14) @@ | ||
| 339 | self.assertTrue(evc.should_deploy(attributes['primary_links'])) |
|
| 340 | log_mock.debug.assert_called_with(f'{evc} will be deployed.') |
|
| 341 | ||
| 342 | @patch('napps.kytos.mef_eline.models.log') |
|
| 343 | def test_should_deploy_case4(self, log_mock): |
|
| 344 | """Test should deploy method with enabled and active circuit.""" |
|
| 345 | log_mock.debug.return_value = True |
|
| 346 | attributes = { |
|
| 347 | "name": "custom_name", |
|
| 348 | "uni_a": get_uni_mocked(is_valid=True), |
|
| 349 | "uni_z": get_uni_mocked(is_valid=True), |
|
| 350 | "primary_links": [get_link_mocked(), get_link_mocked()], |
|
| 351 | "enabled": True, |
|
| 352 | "active": True |
|
| 353 | } |
|
| 354 | evc = EVC(**attributes) |
|
| 355 | self.assertFalse(evc.should_deploy(attributes['primary_links'])) |
|
| 356 | ||
| 357 | @patch('napps.kytos.mef_eline.models.requests') |
|
| 358 | def test_send_flow_mods(self, requests_mock): |
|
| @@ 71-84 (lines=14) @@ | ||
| 68 | self.assertTrue(evc.should_deploy(attributes['primary_links'])) |
|
| 69 | log_mock.debug.assert_called_with(f'{evc} will be deployed.') |
|
| 70 | ||
| 71 | @patch('napps.kytos.mef_eline.models.log') |
|
| 72 | def test_should_deploy_case4(self, log_mock): |
|
| 73 | """Test should deploy method with enabled and active circuit.""" |
|
| 74 | log_mock.debug.return_value = True |
|
| 75 | attributes = { |
|
| 76 | "name": "custom_name", |
|
| 77 | "uni_a": get_uni_mocked(is_valid=True), |
|
| 78 | "uni_z": get_uni_mocked(is_valid=True), |
|
| 79 | "primary_links": [get_link_mocked(), get_link_mocked()], |
|
| 80 | "enabled": True, |
|
| 81 | "active": True |
|
| 82 | } |
|
| 83 | evc = EVC(**attributes) |
|
| 84 | self.assertFalse(evc.should_deploy(attributes['primary_links'])) |
|
| 85 | ||
| 86 | @patch('napps.kytos.mef_eline.models.requests') |
|
| 87 | def test_send_flow_mods(self, requests_mock): |
|