def test_update_security_list_no_security_list_for_update(virtual_network_client): error_message = "No Security List" module = get_module(dict(security_list_id="ocid1.securitylist..xvdf")) try: oci_security_list.update_security_list(virtual_network_client, None, module) except Exception as ex: assert error_message in str(ex.args)
def test_update_security_list_defined_tags_changed(virtual_network_client, update_and_wait_patch): module = get_module(dict(defined_tags=dict(department=dict(department_type='commericial')))) security_list = get_security_list(None, None, 'ansible_security_list') update_and_wait_patch.return_value = dict({'security_list': to_dict(security_list), 'changed': True}) result = oci_security_list.update_security_list(virtual_network_client, security_list, module) assert result['changed'] is True
def test_update_security_list_freeform_tags_changed(virtual_network_client, update_and_wait_patch): module = get_module(dict(freeform_tags=dict(security_level='strict'))) security_list = get_security_list(None, None, 'ansible_security_list') update_and_wait_patch.return_value = dict({'security_list': to_dict(security_list), 'changed': True}) result = oci_security_list.update_security_list(virtual_network_client, security_list, module) assert result['changed'] is True
def test_update_security_list_name_changed(virtual_network_client, update_and_wait_patch): module = get_module(dict({'egress_security_rules': None, 'ingress_security_rules': None, 'purge_security_rules': True})) security_list = get_security_list(None, None, 'ansible_security_list_updated') update_and_wait_patch.return_value = dict({'security_list': to_dict(security_list), 'changed': True}) result = oci_security_list.update_security_list(virtual_network_client, security_list, module) assert result['changed'] is True
def test_update_security_list_freeform_tags_changed( virtual_network_client, update_and_wait_patch ): module = get_module(dict(freeform_tags=dict(security_level="strict"))) security_list = get_security_list(None, None, "ansible_security_list") update_and_wait_patch.return_value = dict( {"security_list": to_dict(security_list), "changed": True} ) result = oci_security_list.update_security_list( virtual_network_client, security_list, module ) assert result["changed"] is True
def test_update_security_list_name_changed(virtual_network_client, update_and_wait_patch): module = get_module( dict({ "egress_security_rules": None, "ingress_security_rules": None, "purge_security_rules": True, })) security_list = get_security_list(None, None, "ansible_security_list_updated") update_and_wait_patch.return_value = dict({ "security_list": to_dict(security_list), "changed": True }) result = oci_security_list.update_security_list(virtual_network_client, security_list, module) assert result["changed"] is True