コード例 #1
0
 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'))
コード例 #2
0
ファイル: logrotate_test.py プロジェクト: lvg01/salt.old
 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)
コード例 #3
0
ファイル: logrotate_test.py プロジェクト: lvg01/salt.old
 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)
コード例 #4
0
ファイル: logrotate_test.py プロジェクト: bryson/salt
 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'))
コード例 #5
0
 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"))
コード例 #6
0
ファイル: test_logrotate.py プロジェクト: morinap/salt-1
 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'))
コード例 #7
0
ファイル: logrotate_test.py プロジェクト: DaveQB/salt
 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)
コード例 #8
0
ファイル: logrotate_test.py プロジェクト: DaveQB/salt
 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)