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