def test_get_pending_update(self):
     """
     If none of the keys exist and there are not subkeys, should return False
     """
     with patch("salt.utils.win_reg.key_exists",
                return_value=False), patch("salt.utils.win_reg.list_keys",
                                           return_value=[]):
         self.assertFalse(win_system.get_pending_update())
Exemple #2
0
 def test_get_pending_update_true_3(self):
     """
     If the Pending key contains subkeys, should return True
     """
     with patch("salt.utils.win_reg.key_exists",
                side_effect=[False,
                             False]), patch("salt.utils.win_reg.list_keys",
                                            return_value=["subkey"]):
         self.assertTrue(win_system.get_pending_update())
 def test_get_pending_update_true_2(self):
     """
     If the PostRebootReporting key exists, should return True
     """
     with patch("salt.utils.win_reg.key_exists", side_effect=[False, True]):
         self.assertTrue(win_system.get_pending_update())
 def test_get_pending_update_true_1(self):
     """
     If the RebootRequired key exists, should return True
     """
     with patch("salt.utils.win_reg.key_exists", side_effect=[True]):
         self.assertTrue(win_system.get_pending_update())