def test_get_dns_config(self): ''' Test if it get the type of DNS configuration (dhcp / static) ''' with patch('salt.utils.winapi.Com', MagicMock()): with patch.object(WMI, 'Win32_NetworkAdapter', return_value=[Mockwmi()]): with patch.object(WMI, 'Win32_NetworkAdapterConfiguration', return_value=[Mockwmi()]): self.assertTrue(win_dns_client.get_dns_config())
def test_get_dns_config(self): ''' Test if it get the type of DNS configuration (dhcp / static) ''' with patch('salt.utils.winapi.Com', MagicMock()), \ patch.object(self.WMI, 'Win32_NetworkAdapter', return_value=[Mockwmi()]), \ patch.object(self.WMI, 'Win32_NetworkAdapterConfiguration', return_value=[Mockwmi()]), \ patch.object(wmi, 'WMI', Mock(return_value=self.WMI)): self.assertTrue(win_dns_client.get_dns_config())
def test_get_dns_config(self): """ Test if it get the type of DNS configuration (dhcp / static) """ with patch("salt.utils.winapi.Com", MagicMock()), patch.object( self.WMI, "Win32_NetworkAdapter", return_value=[Mockwmi()] ), patch.object( self.WMI, "Win32_NetworkAdapterConfiguration", return_value=[Mockwmi()] ), patch.object( wmi, "WMI", Mock(return_value=self.WMI) ): self.assertTrue(win_dns_client.get_dns_config())
def test_get_dns_config(self): ''' Test if it get the type of DNS configuration (dhcp / static) ''' with patch('salt.utils.winapi.Com', MagicMock()): self.assertTrue(win_dns_client.get_dns_config())