예제 #1
0
class BaseTest(object):
    def setUp(self):
        self.path = os.path.join(__file__, u'..', u'..', u'data', u'empty')
        self.path = os.path.normpath(self.path)
        os.mkdir(self.path)
        self.db = BaseModel(self.path)
        self.root = self.db._rootNode

    def tearDown(self):
        os.rmdir(self.path)

    def prepare_update(self):
        self.artist = ArtistNode(parent=self.root)
        meta = {
            u'artist': u'test_artist1',
            u'year': u'2012',
            u'album': u'test_album1',
            u'tracknumber': u'12',
            u'title': u'test_title1'
        }
        self.artist.metadata = meta.copy()
        self.album = AlbumNode(parent=self.artist)
        self.album.metadata = meta.copy()
        self.track = TrackNode(parent=self.album)
        self.track.metadata = meta.copy()
        self.artistIndex = self.db.index(0, 0)
        self.albumIndex = self.db.index(0, 0, self.artistIndex)
        self.trackIndex = self.db.index(0, 0, self.albumIndex)
예제 #2
0
 def setUp(self):
     self.path = os.path.join(__file__, u'..', u'..', u'data', u'empty')
     self.path = os.path.normpath(self.path)
     os.mkdir(self.path)
     self.db = BaseModel(self.path)
     self.root = self.db._rootNode