Ejemplo n.º 1
0
 def test_reload(self):
     self.open_database()
     testobjects.make_device_items(self.device, 'foo.mp3', 'bar.mp3')
     # close, then reopen the database
     self.device.db_info.db.finish_transaction()
     self.open_database()
     # test that the database is still intact by checking the
     # metadata_status table
     cursor = self.device.db_info.db.cursor
     cursor.execute("SELECT path FROM metadata_status")
     paths = [r[0] for r in cursor.fetchall()]
     self.assertSameSet(paths, ['foo.mp3', 'bar.mp3'])
Ejemplo n.º 2
0
 def test_reload(self):
     self.open_database()
     testobjects.make_device_items(self.device, 'foo.mp3', 'bar.mp3')
     # close, then reopen the database
     self.device.db_info.db.finish_transaction()
     self.open_database()
     # test that the database is still intact by checking the
     # metadata_status table
     cursor = self.device.db_info.db.cursor
     cursor.execute("SELECT path FROM metadata_status")
     paths = [r[0] for r in cursor.fetchall()]
     self.assertSameSet(paths, ['foo.mp3', 'bar.mp3'])
Ejemplo n.º 3
0
 def setup_items(self):
     self.device = testobjects.make_mock_device()
     device_items = testobjects.make_device_items(self.device, 'audio1.mp3',
                                                  'audio2.mp3',
                                                  'video1.avi')
     self.audio1, self.audio2, self.video1 = device_items
     self.device.db_info.db.finish_transaction()
Ejemplo n.º 4
0
 def setup_items(self):
     self.device = testobjects.make_mock_device()
     device_items = testobjects.make_device_items(self.device, 'audio1.mp3',
                                                  'audio2.mp3', 'video1.avi')
     self.audio1, self.audio2, self.video1 = device_items
     self.device.db_info.db.finish_transaction()
Ejemplo n.º 5
0
 def setUp(self):
     MiroTestCase.setUp(self)
     self.device = testobjects.make_mock_device()
     self.item_paths = [ 'foo.mp3', 'bar.mp3' ]
     self.device_items = testobjects.make_device_items(self.device,
                                                       *self.item_paths)
Ejemplo n.º 6
0
 def setUp(self):
     MiroTestCase.setUp(self)
     self.device = testobjects.make_mock_device()
     self.item_paths = [ 'foo.mp3', 'bar.mp3' ]
     self.device_items = testobjects.make_device_items(self.device,
                                                       *self.item_paths)