Module Expr Str ImportFrom alias Import alias ImportFrom alias alias ImportFrom alias ImportFrom alias alias alias alias alias alias Expr Call NameLoad Str ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Str Assign NameStore Dict Str Str Str Str ListLoad Str ListLoad Str ListLoad Str ListLoad Str Assign NameStore Str If CompareIs NameLoad NameLoad body Assign NameStore ListLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body With Call NameLoad Str Call NameLoad keyword NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Dict Str Str Str Str ListLoad Str ListLoad Str ListLoad Str ListLoad Str decorator_list FunctionDef arguments args NameParam defaults body With Call NameLoad Str Call NameLoad keyword NameLoad NameStore body Expr Call AttributeLoad NameLoad attr Str Str Str Assign NameStore Call NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str decorator_list Call NameLoad Str Call NameLoad keyword NameLoad FunctionDef arguments args NameParam defaults body Assign NameStore Str Assign NameStore BinOpAdd BinOpAdd BinOpAdd NameLoad Str NameLoad Str With Call NameLoad Str Call NameLoad keyword NameLoad NameStore body Expr Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Call NameLoad Assign NameStore AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body With Call NameLoad Str Call NameLoad keyword NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str decorator_list Call NameLoad NameLoad Str FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num keyword Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num keyword Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num keyword Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num keyword Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num keyword Str decorator_list decorator_list Call NameLoad NameLoad NameLoad If CompareEq NameLoad Str body ImportFrom alias Expr Call NameLoad NameLoad keyword NameLoad
N/A N/A 
    :codeauthor: :email:`Nicole Thomas <nicole@saltstack.com>`
 __future__ absolute_import N/A logging salttesting TestCase skipIf salttesting.helpers ensure_in_syspath salttesting.mock MagicMock patch mock_open call NO_MOCK NO_MOCK_REASON N/A N/A ensure_in_syspath ../../ salt.modules dnsutil N/A log N/A N/A logging getLogger __name__ N/A mock_hosts_file ##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1	localhost
255.255.255.255	broadcasthost
::1             localhost
fe80::1%lo0	localhost N/A mock_hosts_file_rtn N/A ::1 255.255.255.255 127.0.0.1 fe80::1%lo0 N/A localhost N/A broadcasthost N/A localhost N/A localhost N/A mock_soa_zone $TTL 3D
@               IN      SOA     land-5.com. root.land-5.com. (
199609203       ; Serial
28800   ; Refresh
7200    ; Retry
604800  ; Expire
86400)  ; Minimum TTL
NS      land-5.com.

1                       PTR     localhost. N/A N/A NO_MOCK False N/A N/A mock_calls_list N/A N/A N/A call read N/A N/A call write ##
 N/A N/A call write # Host Database
 N/A N/A call write #
 N/A N/A call write # localhost is used to configure the loopback interface
 N/A N/A call write # when the system is booting.  Do not change this entry.
 N/A N/A call write ##
 N/A N/A call write 127.0.0.1 localhost N/A N/A call write N/A N/A call write 255.255.255.255 broadcasthost N/A N/A call write N/A N/A call write ::1 localhost N/A N/A call write N/A N/A call write fe80::1%lo0 localhost N/A N/A call write N/A N/A call close DNSUtilTestCase N/A TestCase N/A test_parse_hosts N/A N/A self N/A N/A N/A N/A patch salt.utils.fopen N/A mock_open read_data mock_hosts_file N/A N/A N/A N/A self assertEqual N/A N/A dnsutil parse_hosts N/A ::1 255.255.255.255 127.0.0.1 fe80::1%lo0 N/A localhost N/A broadcasthost N/A localhost N/A localhost N/A test_hosts_append N/A N/A self N/A N/A N/A N/A patch salt.utils.fopen N/A mock_open read_data mock_hosts_file m_open N/A N/A N/A N/A dnsutil hosts_append /etc/hosts 127.0.0.1 ad1.yuk.co,ad2.yuk.co N/A helper_open N/A m_open N/A N/A N/A N/A helper_open write assert_called_once_with 
127.0.0.1 ad1.yuk.co ad2.yuk.co N/A N/A patch salt.modules.dnsutil.parse_hosts N/A MagicMock return_value mock_hosts_file_rtn test_hosts_remove N/A N/A self N/A N/A N/A to_remove ad1.yuk.co N/A new_mock_file N/A N/A N/A mock_hosts_file 
127.0.0.1  to_remove N/A N/A patch salt.utils.fopen N/A mock_open read_data new_mock_file m_open N/A N/A N/A N/A dnsutil hosts_remove /etc/hosts to_remove N/A helper_open N/A m_open N/A calls_list N/A helper_open method_calls N/A N/A N/A self assertEqual calls_list mock_calls_list N/A test_parse_zone N/A N/A self N/A N/A N/A N/A patch salt.utils.fopen N/A mock_open read_data mock_soa_zone N/A N/A N/A N/A log debug mock_soa_zone N/A N/A N/A log debug N/A N/A dnsutil parse_zone /var/lib/named/example.com.zone N/A N/A skipIf True Waiting on bug report fixes test_to_seconds_hour N/A N/A self N/A N/A N/A N/A N/A self assertEqual N/A N/A dnsutil _to_seconds 4H 14400 msg Did not detect valid hours as invalid N/A test_to_seconds_day N/A N/A self N/A N/A N/A N/A N/A self assertEqual N/A N/A dnsutil _to_seconds 1D 86400 msg Did not detect valid day as invalid N/A test_to_seconds_week N/A N/A self N/A N/A N/A N/A N/A self assertEqual N/A N/A dnsutil _to_seconds 2W 604800 msg Did not set time greater than one week to one week N/A test_to_seconds_empty N/A N/A self N/A N/A N/A N/A N/A self assertEqual N/A N/A dnsutil _to_seconds 604800 msg Did not set empty time to one week N/A test_to_seconds_large N/A N/A self N/A N/A N/A N/A N/A self assertEqual N/A N/A dnsutil _to_seconds 604801 604800 msg Did not set time greater than one week to one week N/A N/A N/A skipIf NO_MOCK NO_MOCK_REASON N/A N/A __name__ __main__ N/A integration run_tests N/A N/A run_tests DNSUtilTestCase needs_daemon False