示例#1
0
 def test_set_dhcp_ip(self):
     """
     Test if it set Windows NIC to get IP from DHCP.
     """
     mock_cmd = MagicMock(return_value=ETHERNET_CONFIG)
     with patch.dict(win_ip.__salt__, {"cmd.run": mock_cmd}):
         self.assertDictEqual(win_ip.set_dhcp_ip("Ethernet"), {"DHCP enabled": "Yes", "Interface": "Ethernet"})
示例#2
0
 def test_set_dhcp_ip(self):
     '''
     Test if it set Windows NIC to get IP from DHCP.
     '''
     mock_cmd = MagicMock(return_value=ETHERNET_CONFIG)
     with patch.dict(win_ip.__salt__, {'cmd.run': mock_cmd}):
         self.assertDictEqual(win_ip.set_dhcp_ip('Ethernet'),
                              {'DHCP enabled': 'Yes',
                               'Interface': 'Ethernet'})
示例#3
0
 def test_set_dhcp_ip(self):
     """
     Test if it set Windows NIC to get IP from DHCP.
     """
     mock_cmd = MagicMock(return_value=ETHERNET_CONFIG)
     with patch.dict(win_ip.__salt__, {"cmd.run": mock_cmd}):
         self.assertDictEqual(
             win_ip.set_dhcp_ip("Ethernet"),
             {
                 "DHCP enabled": "Yes",
                 "Interface": "Ethernet"
             },
         )