| @@ 710-729 (lines=20) @@ | ||
| 707 | log_mocked.debug.assert_called_with(expected_msg) |
|
| 708 | self.assertTrue(expected_deployed) |
|
| 709 | ||
| 710 | @patch('napps.kytos.mef_eline.models.EVCDeploy.deploy') |
|
| 711 | def test_deploy_to_case_2(self, deploy_mocked): |
|
| 712 | """Test deploy with all links up.""" |
|
| 713 | deploy_mocked.return_value = True |
|
| 714 | ||
| 715 | primary_path = [ |
|
| 716 | get_link_mocked(status=EntityStatus.UP), |
|
| 717 | get_link_mocked(status=EntityStatus.UP) |
|
| 718 | ] |
|
| 719 | attributes = { |
|
| 720 | "name": "circuit_name", |
|
| 721 | "uni_a": get_uni_mocked(is_valid=True), |
|
| 722 | "uni_z": get_uni_mocked(is_valid=True), |
|
| 723 | "primary_path": primary_path, |
|
| 724 | "enabled": True |
|
| 725 | } |
|
| 726 | evc = EVC(**attributes) |
|
| 727 | deployed = evc.deploy_to('primary_path', evc.primary_path) |
|
| 728 | deploy_mocked.assert_called_with(evc.primary_path) |
|
| 729 | self.assertTrue(deployed) |
|
| 730 | ||
| 731 | def test_deploy_to_case_3(self): |
|
| 732 | """Test deploy with one link down.""" |
|
| @@ 84-103 (lines=20) @@ | ||
| 81 | log_mocked.debug.assert_called_with(expected_msg) |
|
| 82 | self.assertTrue(expected_deployed) |
|
| 83 | ||
| 84 | @patch('napps.kytos.mef_eline.models.EVCDeploy.deploy') |
|
| 85 | def test_deploy_to_case_2(self, deploy_mocked): |
|
| 86 | """Test deploy with all links up.""" |
|
| 87 | deploy_mocked.return_value = True |
|
| 88 | ||
| 89 | primary_path = [ |
|
| 90 | get_link_mocked(status=EntityStatus.UP), |
|
| 91 | get_link_mocked(status=EntityStatus.UP) |
|
| 92 | ] |
|
| 93 | attributes = { |
|
| 94 | "name": "circuit_name", |
|
| 95 | "uni_a": get_uni_mocked(is_valid=True), |
|
| 96 | "uni_z": get_uni_mocked(is_valid=True), |
|
| 97 | "primary_path": primary_path, |
|
| 98 | "enabled": True |
|
| 99 | } |
|
| 100 | evc = EVC(**attributes) |
|
| 101 | deployed = evc.deploy_to('primary_path', evc.primary_path) |
|
| 102 | deploy_mocked.assert_called_with(evc.primary_path) |
|
| 103 | self.assertTrue(deployed) |
|
| 104 | ||
| 105 | def test_deploy_to_case_3(self): |
|
| 106 | """Test deploy with one link down.""" |
|