コード例 #1
0
 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')
コード例 #2
0
 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')
コード例 #3
0
 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)
コード例 #4
0
 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)
コード例 #5
0
 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)
コード例 #6
0
 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)
コード例 #7
0
 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')
コード例 #8
0
 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')
コード例 #9
0
 def test_carbonDVRDatabase_getPendingRecordings(self):
     db = CarbonDVRDatabase(self.dbConnection)
     pendingRecordings = db.getPendingRecordings(timedelta(hours=12))
コード例 #10
0
 def test_carbonDVRDatabase_getPendingRecordings(self):
     db = CarbonDVRDatabase(self.dbConnection)
     pendingRecordings = db.getPendingRecordings(timedelta(hours=12))