| @@ 687-708 (lines=22) @@ | ||
| 684 | evc.current_path = evc.primary_path |
|
| 685 | self.assertTrue(evc.is_using_primary_path()) |
|
| 686 | ||
| 687 | @patch('napps.kytos.mef_eline.models.log') |
|
| 688 | def test_deploy_to_case_1(self, log_mocked): |
|
| 689 | """Test if the path is equal to current_path.""" |
|
| 690 | primary_path = [ |
|
| 691 | get_link_mocked(endpoint_a_port=9, endpoint_b_port=10, |
|
| 692 | metadata={"s_vlan": 5}), |
|
| 693 | get_link_mocked(endpoint_a_port=11, endpoint_b_port=12, |
|
| 694 | metadata={"s_vlan": 6}) |
|
| 695 | ] |
|
| 696 | attributes = { |
|
| 697 | "name": "circuit_name", |
|
| 698 | "uni_a": get_uni_mocked(is_valid=True), |
|
| 699 | "uni_z": get_uni_mocked(is_valid=True), |
|
| 700 | "primary_path": primary_path |
|
| 701 | } |
|
| 702 | evc = EVC(**attributes) |
|
| 703 | evc.current_path = evc.primary_path |
|
| 704 | ||
| 705 | expected_deployed = evc.deploy_to('primary_path', evc.primary_path) |
|
| 706 | expected_msg = 'primary_path is equal to current_path.' |
|
| 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): |
|
| @@ 61-82 (lines=22) @@ | ||
| 58 | evc.current_path = evc.primary_path |
|
| 59 | self.assertTrue(evc.is_using_primary_path()) |
|
| 60 | ||
| 61 | @patch('napps.kytos.mef_eline.models.log') |
|
| 62 | def test_deploy_to_case_1(self, log_mocked): |
|
| 63 | """Test if the path is equal to current_path.""" |
|
| 64 | primary_path = [ |
|
| 65 | get_link_mocked(endpoint_a_port=9, endpoint_b_port=10, |
|
| 66 | metadata={"s_vlan": 5}), |
|
| 67 | get_link_mocked(endpoint_a_port=11, endpoint_b_port=12, |
|
| 68 | metadata={"s_vlan": 6}) |
|
| 69 | ] |
|
| 70 | attributes = { |
|
| 71 | "name": "circuit_name", |
|
| 72 | "uni_a": get_uni_mocked(is_valid=True), |
|
| 73 | "uni_z": get_uni_mocked(is_valid=True), |
|
| 74 | "primary_path": primary_path |
|
| 75 | } |
|
| 76 | evc = EVC(**attributes) |
|
| 77 | evc.current_path = evc.primary_path |
|
| 78 | ||
| 79 | expected_deployed = evc.deploy_to('primary_path', evc.primary_path) |
|
| 80 | expected_msg = 'primary_path is equal to current_path.' |
|
| 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): |
|