Example #1
0
 def test_cas_not_equal(self):
     '''
     Test if it check and set a value in the minion datastore
     '''
     with patch('salt.modules.data.load',
                MagicMock(return_value={'salt': 'SALT', 'salt1': 'SALT1'})):
         self.assertFalse(data.cas('salt', 'SALT', 'SALTSTACK'))
Example #2
0
 def test_cas(self):
     '''
     Test if it check and set a value in the minion datastore
     '''
     with patch('salt.modules.data.load',
                MagicMock(return_value={'salt': 'SALT', 'salt1': 'SALT1'})), \
                        patch('salt.modules.data.dump',
                              MagicMock(return_value=True)):
         self.assertTrue(data.cas('salt', 'SALTSTACK', 'SALT'))
Example #3
0
 def test_cas(self):
     """
     Test if it check and set a value in the minion datastore
     """
     with patch(
         "salt.modules.data.load",
         MagicMock(return_value={"salt": "SALT", "salt1": "SALT1"}),
     ), patch("salt.modules.data.dump", MagicMock(return_value=True)):
         self.assertTrue(data.cas("salt", "SALTSTACK", "SALT"))
Example #4
0
 def test_cas_not_equal(self):
     """
     Test if it check and set a value in the minion datastore
     """
     with patch(
         "salt.modules.data.load",
         MagicMock(return_value={"salt": "SALT", "salt1": "SALT1"}),
     ):
         self.assertFalse(data.cas("salt", "SALT", "SALTSTACK"))
Example #5
0
def test_cas_not_load():
    """
    Test if it check and set a value in the minion datastore
    """
    with patch(
            "salt.modules.data.load",
            MagicMock(return_value={
                "salt": "SALT",
                "salt1": "SALT1"
            }),
    ):
        assert not data.cas("salt3", "SALT", "SALTSTACK")
Example #6
0
 def test_cas(self):
     '''
     Test if it check and set a value in the minion datastore
     '''
     self.assertTrue(data.cas('salt', 'SALTSTACK', 'SALT'))
Example #7
0
 def test_cas_not_equal(self):
     '''
     Test if it check and set a value in the minion datastore
     '''
     self.assertFalse(data.cas('salt', 'SALT', 'SALTSTACK'))
Example #8
0
 def test_cas(self):
     '''
     Test if it check and set a value in the minion datastore
     '''
     self.assertTrue(data.cas('salt', 'SALTSTACK', 'SALT'))
Example #9
0
 def test_cas_not_equal(self):
     '''
     Test if it check and set a value in the minion datastore
     '''
     self.assertFalse(data.cas('salt', 'SALT', 'SALTSTACK'))