| @@ 666-685 (lines=20) @@ | ||
| 663 | evc.current_path = evc.backup_path |
|
| 664 | self.assertTrue(evc.is_using_backup_path()) |
|
| 665 | ||
| 666 | def test_is_using_primary_path(self): |
|
| 667 | """Test test is using primary path.""" |
|
| 668 | primary_path = [ |
|
| 669 | get_link_mocked(endpoint_a_port=9, endpoint_b_port=10, |
|
| 670 | metadata={"s_vlan": 5}), |
|
| 671 | get_link_mocked(endpoint_a_port=11, endpoint_b_port=12, |
|
| 672 | metadata={"s_vlan": 6}) |
|
| 673 | ] |
|
| 674 | ||
| 675 | attributes = { |
|
| 676 | "name": "circuit_name", |
|
| 677 | "uni_a": get_uni_mocked(is_valid=True), |
|
| 678 | "uni_z": get_uni_mocked(is_valid=True), |
|
| 679 | "primary_path": primary_path |
|
| 680 | } |
|
| 681 | ||
| 682 | evc = EVC(**attributes) |
|
| 683 | self.assertFalse(evc.is_using_primary_path()) |
|
| 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): |
|
| @@ 40-59 (lines=20) @@ | ||
| 37 | evc.current_path = evc.backup_path |
|
| 38 | self.assertTrue(evc.is_using_backup_path()) |
|
| 39 | ||
| 40 | def test_is_using_primary_path(self): |
|
| 41 | """Test test is using primary path.""" |
|
| 42 | primary_path = [ |
|
| 43 | get_link_mocked(endpoint_a_port=9, endpoint_b_port=10, |
|
| 44 | metadata={"s_vlan": 5}), |
|
| 45 | get_link_mocked(endpoint_a_port=11, endpoint_b_port=12, |
|
| 46 | metadata={"s_vlan": 6}) |
|
| 47 | ] |
|
| 48 | ||
| 49 | attributes = { |
|
| 50 | "name": "circuit_name", |
|
| 51 | "uni_a": get_uni_mocked(is_valid=True), |
|
| 52 | "uni_z": get_uni_mocked(is_valid=True), |
|
| 53 | "primary_path": primary_path |
|
| 54 | } |
|
| 55 | ||
| 56 | evc = EVC(**attributes) |
|
| 57 | self.assertFalse(evc.is_using_primary_path()) |
|
| 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): |
|