Esempio n. 1
0
 def test_parse_hosts(self):
     with patch('salt.utils.fopen', mock_open(read_data=mock_hosts_file)):
         self.assertEqual(
             dnsutil.parse_hosts(), {
                 '::1': ['localhost'],
                 '255.255.255.255': ['broadcasthost'],
                 '127.0.0.1': ['localhost'],
                 'fe80::1%lo0': ['localhost']
             })
Esempio n. 2
0
 def test_parse_hosts(self):
     with patch("salt.utils.files.fopen", mock_open(read_data=mock_hosts_file)):
         self.assertEqual(
             dnsutil.parse_hosts(),
             {
                 "::1": ["localhost"],
                 "255.255.255.255": ["broadcasthost"],
                 "127.0.0.1": ["localhost"],
                 "fe80::1%lo0": ["localhost"],
             },
         )
Esempio n. 3
0
 def test_parse_hosts(self):
     with patch('salt.utils.fopen', mock_open(read_data=mock_hosts_file)):
         self.assertEqual(dnsutil.parse_hosts(), {'::1': ['localhost'],
                                                  '255.255.255.255': ['broadcasthost'],
                                                  '127.0.0.1': ['localhost'],
                                                  'fe80::1%lo0': ['localhost']})