Beispiel #1
0
def test_list_dhcp_optionss(virtual_network_client, list_all_resources_patch):
    module = get_module()
    dhcp_options = get_dhcp_options()
    list_all_resources_patch.return_value = [dhcp_options]
    result = oci_dhcp_options_facts.list_dhcp_options(virtual_network_client,
                                                      module)
    assert result['dhcp_options_list'][0][
        'display_name'] == dhcp_options.display_name
Beispiel #2
0
def test_list_dhcp_optionss_with_ig_id(virtual_network_client,
                                       list_all_resources_patch):
    module = get_module_with_dhcp_id()
    dhcp_options = get_dhcp_options()
    virtual_network_client.get_dhcp_options.return_value = get_response(
        200, None, dhcp_options, None)
    result = oci_dhcp_options_facts.list_dhcp_options(virtual_network_client,
                                                      module)
    assert result['dhcp_options_list'][0][
        'display_name'] == dhcp_options.display_name
Beispiel #3
0
def test_list_dhcp_optionss_service_error(virtual_network_client,
                                          list_all_resources_patch):
    error_message = 'Internal Server Error'
    module = get_module()
    list_all_resources_patch.side_effect = ServiceError(
        499, 'InternalServerError', dict(), error_message)
    try:
        result = oci_dhcp_options_facts.list_dhcp_options(
            virtual_network_client, module)
    except Exception as ex:
        assert error_message in ex.args[0]