Exemplo n.º 1
0
 def test_is_enabled(self):
     """
     Test if it returns `True` if interface is enabled, otherwise `False`.
     """
     mock_cmd = MagicMock(side_effect=[ETHERNET_ENABLE, ""])
     with patch.dict(win_ip.__salt__, {"cmd.run": mock_cmd}):
         self.assertTrue(win_ip.is_enabled("Ethernet"))
         self.assertRaises(CommandExecutionError, win_ip.is_enabled, "Ethernet")
Exemplo n.º 2
0
 def test_is_enabled(self):
     '''
     Test if it returns `True` if interface is enabled, otherwise `False`.
     '''
     mock_cmd = MagicMock(side_effect=[ETHERNET_ENABLE, ''])
     with patch.dict(win_ip.__salt__, {'cmd.run': mock_cmd}):
         self.assertTrue(win_ip.is_enabled('Ethernet'))
         self.assertRaises(CommandExecutionError, win_ip.is_enabled,
                           'Ethernet')
Exemplo n.º 3
0
 def test_is_enabled(self):
     """
     Test if it returns `True` if interface is enabled, otherwise `False`.
     """
     mock_cmd = MagicMock(side_effect=[ETHERNET_ENABLE, ""])
     with patch.dict(win_ip.__salt__, {"cmd.run": mock_cmd}):
         self.assertTrue(win_ip.is_enabled("Ethernet"))
         self.assertRaises(CommandExecutionError, win_ip.is_enabled,
                           "Ethernet")