def test_set_setting(self): ''' Test if it set a new value for a specific configuration line ''' with patch.dict(logrotate.__salt__, {'file.replace': MagicMock(return_value=True)}): self.assertTrue(logrotate.set_('/var/log/wtmp', 'rotate', '2'))
def test_set_setting(self): ''' Test if it set a new value for a specific configuration line ''' ret = ('Error: A setting for a dict was declared, ' 'but the configuration line given is not a dict') self.assertEqual(logrotate.set_('rotate', '2', True), ret)
def test_set(self): ''' Test if it set a new value for a specific configuration line ''' ret = ('Error: rotate includes a dict, and a specific ' 'setting inside the dict was not declared') self.assertEqual(logrotate.set_('rotate', '2'), ret)
def test_set_setting(self): """ Test if it set a new value for a specific configuration line """ with patch.dict(logrotate.__salt__, {"file.replace": MagicMock(return_value=True)}), patch( "salt.modules.logrotate._parse_conf", MagicMock(return_value=PARSE_CONF)): self.assertTrue(logrotate.set_("/var/log/wtmp", "rotate", "2"))
def test_set(self): ''' Test if it set a new value for a specific configuration line ''' with patch('salt.modules.logrotate._parse_conf', MagicMock(return_value=PARSE_CONF)), \ patch.dict(logrotate.__salt__, {'file.replace': MagicMock(return_value=True)}): self.assertTrue(logrotate.set_('rotate', '2'))
def test_set_setting(self): ''' Test if it set a new value for a specific configuration line ''' ret = ( 'Error: A setting for a dict was declared, ' 'but the configuration line given is not a dict' ) self.assertEqual(logrotate.set_('rotate', '2', True), ret)
def test_set(self): ''' Test if it set a new value for a specific configuration line ''' ret = ( 'Error: rotate includes a dict, and a specific ' 'setting inside the dict was not declared' ) self.assertEqual(logrotate.set_('rotate', '2'), ret)