def test_should_deploy_case1(log_mock): """Test should deploy method without primary links.""" log_mock.debug.return_value = True attributes = { "controller": get_controller_mock(), "name": "custom_name", "uni_a": get_uni_mocked(is_valid=True), "uni_z": get_uni_mocked(is_valid=True) } evc = EVC(**attributes) evc.should_deploy() log_mock.debug.assert_called_with('Path is empty.')
def test_should_deploy_case2(self, log_mock): """Test should deploy method with disable circuit.""" log_mock.debug.return_value = True attributes = { "controller": get_controller_mock(), "name": "custom_name", "uni_a": get_uni_mocked(is_valid=True), "uni_z": get_uni_mocked(is_valid=True), "primary_links": [get_link_mocked(), get_link_mocked()] } evc = EVC(**attributes) self.assertFalse(evc.should_deploy(attributes['primary_links'])) log_mock.debug.assert_called_with(f'{evc} is disabled.')
def test_should_deploy_case4(self, log_mock): """Test should deploy method with enabled and active circuit.""" log_mock.debug.return_value = True attributes = { "controller": get_controller_mock(), "name": "custom_name", "uni_a": get_uni_mocked(is_valid=True), "uni_z": get_uni_mocked(is_valid=True), "primary_links": [get_link_mocked(), get_link_mocked()], "enabled": True, "active": True } evc = EVC(**attributes) self.assertFalse(evc.should_deploy(attributes['primary_links']))
def test_should_deploy_case3(self, log_mock): """Test should deploy method with enabled and not active circuit.""" log_mock.debug.return_value = True attributes = { "controller": get_controller_mock(), "name": "custom_name", "uni_a": get_uni_mocked(is_valid=True), "uni_z": get_uni_mocked(is_valid=True), "primary_links": [get_link_mocked(), get_link_mocked()], "enabled": True, } evc = EVC(**attributes) self.assertTrue(evc.should_deploy(attributes["primary_links"])) log_mock.debug.assert_called_with(f"{evc} will be deployed.")