Ejemplo n.º 1
0
 def test_insert_new_artist(self):
     artist1 = ArtistNode(parent=self.root)
     artist1.metadata = {u'artist': u'test_artist1'}
     self.db.upsert(None, {
         u'artist': u'test_artist2'
     })
     artist2 = self.root.child(1)
     assert artist2.metadata == {u'artist': u'test_artist2'}
Ejemplo n.º 2
0
 def test_insert_new_album_to_artist(self):
     artist = ArtistNode(parent=self.root)
     artist.metadata = {u'artist': u'test_artist'}
     result = {
         u'artist': u'test_artist',
         u'year': u'2012',
         u'album': u'test_album'
     }
     self.db.upsert(None, result)
     album = artist.child(0)
     assert album.metadata == result
     assert artist.metadata == result
Ejemplo n.º 3
0
 def test_insert_new_track_to_album(self):
     artist = ArtistNode(parent=self.root)
     artist.metadata = {u'artist': u'test_artist'}
     album = AlbumNode(parent=artist)
     album.metadata = {u'year': u'2012', u'album': u'test_album'}
     result = {
         u'artist': u'test_artist',
         u'year': u'2012',
         u'album': u'test_album',
         u'tracknumber': u'12',
         u'title': u'test_title'
     }
     self.db.upsert(None, result)
     track = album.child(0)
     assert track.metadata == result
     assert album.metadata == result
     assert artist.metadata == result