@@ 81-95 (lines=15) @@ | ||
78 | assert evc.should_deploy(attributes["primary_links"]) is False |
|
79 | log_mock.debug.assert_called_with(f"{evc} is disabled.") |
|
80 | ||
81 | @patch("napps.kytos.mef_eline.models.evc.log") |
|
82 | def test_should_deploy_case3(self, log_mock): |
|
83 | """Test should deploy method with enabled and not active circuit.""" |
|
84 | log_mock.debug.return_value = True |
|
85 | attributes = { |
|
86 | "controller": get_controller_mock(), |
|
87 | "name": "custom_name", |
|
88 | "uni_a": get_uni_mocked(is_valid=True), |
|
89 | "uni_z": get_uni_mocked(is_valid=True), |
|
90 | "primary_links": [get_link_mocked(), get_link_mocked()], |
|
91 | "enabled": True, |
|
92 | } |
|
93 | evc = EVC(**attributes) |
|
94 | assert evc.should_deploy(attributes["primary_links"]) is True |
|
95 | log_mock.debug.assert_called_with(f"{evc} will be deployed.") |
|
96 | ||
97 | @patch("napps.kytos.mef_eline.models.evc.log") |
|
98 | def test_should_deploy_case4(self, log_mock): |
|
@@ 65-79 (lines=15) @@ | ||
62 | evc.should_deploy() |
|
63 | log_mock.debug.assert_called_with("Path is empty.") |
|
64 | ||
65 | @patch("napps.kytos.mef_eline.models.evc.log") |
|
66 | def test_should_deploy_case2(self, log_mock): |
|
67 | """Test should deploy method with disable circuit.""" |
|
68 | log_mock.debug.return_value = True |
|
69 | attributes = { |
|
70 | "controller": get_controller_mock(), |
|
71 | "name": "custom_name", |
|
72 | "uni_a": get_uni_mocked(is_valid=True), |
|
73 | "uni_z": get_uni_mocked(is_valid=True), |
|
74 | "primary_links": [get_link_mocked(), get_link_mocked()], |
|
75 | } |
|
76 | evc = EVC(**attributes) |
|
77 | ||
78 | assert evc.should_deploy(attributes["primary_links"]) is False |
|
79 | log_mock.debug.assert_called_with(f"{evc} is disabled.") |
|
80 | ||
81 | @patch("napps.kytos.mef_eline.models.evc.log") |
|
82 | def test_should_deploy_case3(self, log_mock): |