def test_carbonDVRDatabase_insertRawVideoLocation(self): self.insertShow('show', 'EP', 'foo') self.insertEpisode('show', 'episode', 'foo', 'foo') self.insertRecording(1, 'show', 'episode', '1970-01-01', timedelta(minutes=30), 'R') db = CarbonDVRDatabase(self.dbConnection) rowsInserted = db.insertRawVideoLocation(recordingID='1', filename='1')
def test_carbonDVRDatabase_insertRecording(self): self.insertShow('show', 'EP', 'foo') self.insertEpisode('show', 'episode', 'foo', 'foo') db = CarbonDVRDatabase(self.dbConnection) rowsInserted = db.insertRecording(recordingID='1', showID='show', episodeID='episode', duration='1', rerunCode='R')
def test_carbonDVRDatabase_getTuners(self): self.assertEqual(1, self.insertTuner('foo','192.168.1.1',1)) self.assertEqual(1, self.insertTuner('baz','10.10.10.1',0)) db = CarbonDVRDatabase(self.dbConnection) tuners = sorted(db.getTuners(), key=lambda tuner:tuner.deviceID) self.assertEqual(2, len(tuners)) self.assertEqual('baz', tuners[0].deviceID) self.assertEqual('10.10.10.1', tuners[0].ipAddress) self.assertEqual(0, tuners[0].tunerID) self.assertEqual('foo', tuners[1].deviceID) self.assertEqual('192.168.1.1', tuners[1].ipAddress) self.assertEqual(1, tuners[1].tunerID)
def test_carbonDVRDatabase_getTuners(self): self.assertEqual(1, self.insertTuner('foo', '192.168.1.1', 1)) self.assertEqual(1, self.insertTuner('baz', '10.10.10.1', 0)) db = CarbonDVRDatabase(self.dbConnection) tuners = sorted(db.getTuners(), key=lambda tuner: tuner.deviceID) self.assertEqual(2, len(tuners)) self.assertEqual('baz', tuners[0].deviceID) self.assertEqual('10.10.10.1', tuners[0].ipAddress) self.assertEqual(0, tuners[0].tunerID) self.assertEqual('foo', tuners[1].deviceID) self.assertEqual('192.168.1.1', tuners[1].ipAddress) self.assertEqual(1, tuners[1].tunerID)
def test_carbonDVRDatabase_getChannels(self): self.assertEqual(1, self.insertChannel(4,1,5,1)) self.assertEqual(1, self.insertChannel(19,3,18,2)) self.assertEqual(1, self.insertChannel(5,2,37,3)) db = CarbonDVRDatabase(self.dbConnection) channels = sorted(db.getChannels(), key=lambda channel:channel.channelMajor) self.assertEqual(3, len(channels)) self.assertEqual(4, channels[0].channelMajor) self.assertEqual(1, channels[0].channelMinor) self.assertEqual(5, channels[0].channelActual) self.assertEqual(1, channels[0].program) self.assertEqual(5, channels[1].channelMajor) self.assertEqual(2, channels[1].channelMinor) self.assertEqual(37, channels[1].channelActual) self.assertEqual(3, channels[1].program) self.assertEqual(19, channels[2].channelMajor) self.assertEqual(3, channels[2].channelMinor) self.assertEqual(18, channels[2].channelActual) self.assertEqual(2, channels[2].program)
def test_carbonDVRDatabase_getChannels(self): self.assertEqual(1, self.insertChannel(4, 1, 5, 1)) self.assertEqual(1, self.insertChannel(19, 3, 18, 2)) self.assertEqual(1, self.insertChannel(5, 2, 37, 3)) db = CarbonDVRDatabase(self.dbConnection) channels = sorted(db.getChannels(), key=lambda channel: channel.channelMajor) self.assertEqual(3, len(channels)) self.assertEqual(4, channels[0].channelMajor) self.assertEqual(1, channels[0].channelMinor) self.assertEqual(5, channels[0].channelActual) self.assertEqual(1, channels[0].program) self.assertEqual(5, channels[1].channelMajor) self.assertEqual(2, channels[1].channelMinor) self.assertEqual(37, channels[1].channelActual) self.assertEqual(3, channels[1].program) self.assertEqual(19, channels[2].channelMajor) self.assertEqual(3, channels[2].channelMinor) self.assertEqual(18, channels[2].channelActual) self.assertEqual(2, channels[2].program)
def test_carbonDVRDatabase_insertRawVideoLocation(self): self.insertShow('show','EP','foo') self.insertEpisode('show','episode','foo','foo') self.insertRecording(1,'show','episode', '1970-01-01', timedelta(minutes=30), 'R') db = CarbonDVRDatabase(self.dbConnection) rowsInserted = db.insertRawVideoLocation(recordingID='1',filename='1')
def test_carbonDVRDatabase_insertRecording(self): self.insertShow('show','EP','foo') self.insertEpisode('show','episode','foo','foo') db = CarbonDVRDatabase(self.dbConnection) rowsInserted = db.insertRecording(recordingID='1',showID='show', episodeID='episode',duration='1',rerunCode='R')
def test_carbonDVRDatabase_getPendingRecordings(self): db = CarbonDVRDatabase(self.dbConnection) pendingRecordings = db.getPendingRecordings(timedelta(hours=12))