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'})
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"})