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