示例#1
0
 def test_mod_watch(self):
     '''
         Test to the tomcat watcher function.
     '''
     ret = {'name': 'salt',
            'changes': {},
            'result': False,
            'comment': 'True'}
     mock = MagicMock(return_value='True')
     with patch.dict(tomcat.__salt__, {"tomcat.reload": mock}):
         ret.update({'changes': {'salt': False}})
         self.assertDictEqual(tomcat.mod_watch('salt'), ret)
示例#2
0
 def test_mod_watch(self):
     '''
     Test to the tomcat watcher function.
     '''
     ret = {'name': 'salt',
            'changes': {},
            'result': False,
            'comment': 'True'}
     mock = MagicMock(return_value='True')
     with patch.dict(tomcat.__salt__, {"tomcat.reload": mock}):
         ret.update({'changes': {'salt': False}})
         self.assertDictEqual(tomcat.mod_watch('salt'), ret)
示例#3
0
def test_mod_watch():
    """
    Test to the tomcat watcher function.
    """
    ret = {"name": "salt", "changes": {}, "result": False, "comment": "True"}
    mock = MagicMock(return_value="True")
    with patch.dict(
            tomcat.__salt__,
        {
            "tomcat.reload": mock,
            "tomcat.extract_war_version": tomcatmod.extract_war_version,
        },
    ):
        ret.update({"changes": {"salt": False}})
        assert tomcat.mod_watch("salt") == ret