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