示例#1
0
 def test_get_config(self):
     '''
     test to dumps all options from the config file.
     '''
     mock = MagicMock(return_value={'conf-dir': 'A'})
     with patch.object(dnsmasq, 'get_config', mock):
         mock = MagicMock(return_value=['.', '~', 'bak', '#'])
         with patch.object(os, 'listdir', mock):
             self.assertDictEqual(dnsmasq.get_config(), {'conf-dir': 'A'})
示例#2
0
 def test_get_config(self):
     '''
     test to dumps all options from the config file.
     '''
     mock = MagicMock(return_value={'conf-dir': 'A'})
     with patch.object(dnsmasq, 'get_config', mock):
         mock = MagicMock(return_value=['.', '~', 'bak', '#'])
         with patch.object(os, 'listdir', mock):
             self.assertDictEqual(dnsmasq.get_config(), {'conf-dir': 'A'})
示例#3
0
 def test_get_config(self):
     """
     test to dumps all options from the config file.
     """
     mock = MagicMock(return_value={"conf-dir": "A"})
     with patch.object(dnsmasq, "get_config", mock):
         mock = MagicMock(return_value=[".", "~", "bak", "#"])
         with patch.object(os, "listdir", mock):
             self.assertDictEqual(dnsmasq.get_config(), {"conf-dir": "A"})