예제 #1
0
    def test_syslog(self):
        '''
        Tests for configure syslog remote logging, by default syslog will
        automatically be enabled if a server is specified. However,
        if you want to disable syslog you will need to specify a server
        followed by False
        '''
        mock = MagicMock(return_value=True)
        with patch.object(drac, '__execute_cmd', mock):
            self.assertTrue(drac.syslog('server'))

        mock = MagicMock(return_value=True)
        with patch.object(drac, '__execute_cmd', mock):
            self.assertTrue(drac.syslog('server', False))
예제 #2
0
파일: drac_test.py 프로젝트: DaveQB/salt
    def test_syslog(self):
        '''
        Tests for configure syslog remote logging, by default syslog will
        automatically be enabled if a server is specified. However,
        if you want to disable syslog you will need to specify a server
        followed by False
        '''
        mock = MagicMock(return_value=True)
        with patch.object(drac, '__execute_cmd', mock):
            self.assertTrue(drac.syslog('server'))

        mock = MagicMock(return_value=True)
        with patch.object(drac, '__execute_cmd', mock):
            self.assertTrue(drac.syslog('server', False))