コード例 #1
0
ファイル: test_hdhomerun.py プロジェクト: carbonDVR/carbonDVR
 def test_hdhomeruninterface_record_noTuners(self):
     hdhomerun = HDHomeRunInterface([], [], '/bin/false')
     hdhomerun.logger = Mock()
     hdhomerun.channelMap.getChannelInfo = Mock(autospec=True, return_value=self.channelA)
     hdhomerun.tunerList.lockTuner = Mock(autospec=True, return_value=None)
     with self.assertRaises(NoTunersAvailableException):
         hdhomerun.record(self.channelA.channelMajor, self.channelA.channelMinor, self.stoptime, '/tmp/', '/tmp/')
コード例 #2
0
ファイル: test_hdhomerun.py プロジェクト: carbonDVR/carbonDVR
 def test_hdhomeruninterface_record_badChannel(self):
     hdhomerun = HDHomeRunInterface([], [], '/bin/false')
     hdhomerun.logger = Mock()
     hdhomerun.channelMap.getChannel = Mock(return_value=None)
     hdhomerun.tunerList.lockTuner = Mock(return_value=self.tunerA)
     with self.assertRaises(UnrecognizedChannelException):
         hdhomerun.record(36, 1, self.stoptime, '/tmp/', '/tmp/')
コード例 #3
0
ファイル: test_hdhomerun.py プロジェクト: carbonDVR/carbonDVR
 def test_hdhomeruninterface_record_syntaxcheck(self):
     with patch.multiple('recorder.hdhomerun', io=DEFAULT, os=DEFAULT, subprocess=DEFAULT, time=DEFAULT, isaValidRecording=DEFAULT) as patchMocks:
         hdhomerunInterface = HDHomeRunInterface([], [], '/bin/false')
         hdhomerunInterface.logger = Mock()
         hdhomerunInterface.channelMap.getChannelInfo = Mock(autospec=True, return_value=self.channelA)
         hdhomerunInterface.tunerList.lockTuner = Mock(autospec=True, return_value=self.tunerA)
         hdhomerunInterface.record(self.channelA.channelMajor, self.channelA.channelMinor, self.stoptime, '/tmp/', '/tmp/')
コード例 #4
0
 def test_hdhomeruninterface_record_badChannel(self):
     hdhomerun = HDHomeRunInterface([], [], '/bin/false')
     hdhomerun.logger = Mock()
     hdhomerun.channelMap.getChannel = Mock(return_value=None)
     hdhomerun.tunerList.lockTuner = Mock(return_value=self.tunerA)
     with self.assertRaises(UnrecognizedChannelException):
         hdhomerun.record(36, 1, self.stoptime, '/tmp/', '/tmp/')
コード例 #5
0
 def test_hdhomeruninterface_record_noTuners(self):
     hdhomerun = HDHomeRunInterface([], [], '/bin/false')
     hdhomerun.logger = Mock()
     hdhomerun.channelMap.getChannelInfo = Mock(autospec=True,
                                                return_value=self.channelA)
     hdhomerun.tunerList.lockTuner = Mock(autospec=True, return_value=None)
     with self.assertRaises(NoTunersAvailableException):
         hdhomerun.record(self.channelA.channelMajor,
                          self.channelA.channelMinor, self.stoptime,
                          '/tmp/', '/tmp/')
コード例 #6
0
 def test_hdhomeruninterface_record_syntaxcheck(self):
     with patch.multiple('recorder.hdhomerun',
                         io=DEFAULT,
                         os=DEFAULT,
                         subprocess=DEFAULT,
                         time=DEFAULT,
                         isaValidRecording=DEFAULT) as patchMocks:
         hdhomerunInterface = HDHomeRunInterface([], [], '/bin/false')
         hdhomerunInterface.logger = Mock()
         hdhomerunInterface.channelMap.getChannelInfo = Mock(
             autospec=True, return_value=self.channelA)
         hdhomerunInterface.tunerList.lockTuner = Mock(
             autospec=True, return_value=self.tunerA)
         hdhomerunInterface.record(self.channelA.channelMajor,
                                   self.channelA.channelMinor,
                                   self.stoptime, '/tmp/', '/tmp/')