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/')
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/')
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/')
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/')