コード例 #1
0
 def getUserJobs(self):
     '''Returns max of 4 user jobs defined in the SETTING table'''
     from mythbox.mythtv.domain import UserJob
     userJobs = []
     types = [JobType.USERJOB1, JobType.USERJOB2, JobType.USERJOB3, JobType.USERJOB4]
     keys = [('UserJob%d' % i, 'UserJobDesc%d' % i, types[i-1]) for i in xrange(1,5)]
     for jobCommand, jobDesc, jobType in keys:            
         userJobs.append(UserJob(jobType, self.getMythSetting(jobDesc), self.getMythSetting(jobCommand)))  
     return userJobs
コード例 #2
0
 def test_isActive_When_command_none_Then_return_false(self):
     self.assertFalse(UserJob(JobType.USERJOB1, 'Send to Ipad', None).isActive())
コード例 #3
0
 def test_isActive_When_command_not_none_Then_return_true(self):
     self.assertTrue(UserJob(JobType.USERJOB1, 'Send to Ipad', 'HandBrakeCLI blah blal blah').isActive())