Example #1
0
 def test_enable(self):
     '''
     Test if it enable firewall profile :(default: allprofiles)
     '''
     mock_cmd = MagicMock(return_value='Ok.')
     with patch.dict(win_firewall.__salt__, {'cmd.run': mock_cmd}):
         self.assertTrue(win_firewall.enable())
Example #2
0
 def test_enable(self):
     """
     Test if it enable firewall profile :(default: allprofiles)
     """
     mock_cmd = MagicMock(return_value="Ok.")
     with patch.dict(win_firewall.__salt__, {"cmd.run": mock_cmd}):
         self.assertTrue(win_firewall.enable())
Example #3
0
 def test_enable(self):
     '''
     Test if it enable firewall profile :(default: allprofiles)
     '''
     mock_cmd = MagicMock(return_value='Ok.')
     with patch.dict(win_firewall.__salt__, {'cmd.run': mock_cmd}):
         self.assertTrue(win_firewall.enable())
         mock_cmd.assert_called_once_with(['netsh', 'advfirewall', 'set', 'allprofiles', 'state', 'on'],
                                          python_shell=False)