コード例 #1
0
 def runTest(self, mock_triggered):
     ''' Execute test '''
     scheduler = mock.Mock(**{'add_job.return_value': True})
     self.target.update({
         'runbooks': {
             'test': {
                 'schedule': {
                     'second': 1,
                     'minute': 1,
                     'hour': 1,
                     'day': 1,
                     'month': 1,
                     'day_of_week': 1
                 },
             }
         }
     })
     self.assertTrue(
         schedule(scheduler, "test", self.target, self.config, self.dbc,
                  self.logger))
     self.assertTrue(
         mock_triggered.called_with(second=1,
                                    minute=1,
                                    hour=1,
                                    day=1,
                                    month=1,
                                    day_of_week=1))
コード例 #2
0
 def runTest(self, mock_triggered):
     ''' Execute test '''
     scheduler = mock.Mock(**{
         'add_job.return_value' : True
     })
     self.target.update({
         'runbooks' : {
             'test' : {
                 'schedule' : "* * * * *",
                 'nodes' : [
                     'tes*'
                 ]
             }
         }
     })
     self.assertTrue(schedule(
         scheduler,
         "test",
         self.target,
         self.config,
         self.dbc,
         self.logger))
     self.assertTrue(mock_triggered.called_with(
         minute="*",
         hour="*",
         day="*",
         month="*",
         day_of_week="*"))
コード例 #3
0
 def runTest(self, mock_triggered):
     ''' Execute test '''
     scheduler = mock.Mock(**{'add_job.return_value': True})
     self.target.update({'runbooks': {'test': {}}})
     self.assertTrue(
         schedule(scheduler, "test", self.target, self.config, self.dbc,
                  self.logger))
     self.assertTrue(
         mock_triggered.called_with(second=0,
                                    minute='*',
                                    hour='*',
                                    day='*',
                                    month='*',
                                    day_of_week='*'))
コード例 #4
0
 def runTest(self, mock_triggered):
     ''' Execute test '''
     scheduler = mock.Mock(**{
         'add_job.return_value' : True
     })
     self.target.update({
         'runbooks' : {
             'test' : {
                 'schedule' : {
                     'second' : 1,
                     'minute' : 1,
                     'hour' : 1,
                     'day' : 1,
                     'month' : 1,
                     'day_of_week' : 1
                 },
                 'nodes' : [
                     'tes*'
                 ]
             }
         }
     })
     self.assertTrue(schedule(
         scheduler,
         "test",
         self.target,
         self.config,
         self.dbc,
         self.logger))
     self.assertTrue(mock_triggered.called_with(
         second=1,
         minute=1,
         hour=1,
         day=1,
         month=1,
         day_of_week=1))