Esempio n. 1
0
 def test_identify_artists(self):
     basicConfig(level=DEBUG)
     delete_db(dir=TEST_DIR)
     session = open_db(dir=TEST_DIR)()
     scan_dirs(session, ['/home/andrew/projects/personal/uykfe/data'])
     session.commit()
     identify_artists(dir=TEST_DIR)
Esempio n. 2
0
 def test_identify_artists(self):
     basicConfig(level=DEBUG)
     delete_db(dir=TEST_DIR)
     session = open_db(dir=TEST_DIR)()
     scan_dirs(session, ['/home/andrew/projects/personal/uykfe/data'])
     session.commit()
     identify_artists(dir=TEST_DIR)
Esempio n. 3
0
 def test_scan_mp3s(self):
     basicConfig(level=DEBUG)
     delete_db(dir=TEST_DIR)
     session = open_db(dir=TEST_DIR)()
     artist = LocalArtist(name="test artist")
     session.add(artist)
     track = LocalTrack(name="test track", url="test url", local_artist=artist.id)
     session.add(track)
     session.flush()
     assert session.query(LocalTrack).filter(LocalTrack.url == track.url).count() == 1
     scan_dirs(session, ["/home/andrew/projects/personal/uykfe/data"])
     assert session.query(LocalTrack).filter(LocalTrack.url == track.url).count() == 0
Esempio n. 4
0
File: db.py Progetto: Robbt/uykfe
 def test_create_local_artist(self):
     delete_db(dir=TEST_DIR)
     session_factory = open_db(dir=TEST_DIR)
     session = session_factory()
     artist = LocalArtist('test artist')
     session.add(artist)
     assert not artist.id
     session.commit()
     assert artist.id
     session.close()
     session = session_factory()
     assert session.query(LocalArtist).count()
     artists = session.query(LocalArtist).all()
     assert len(artists) == 1, artists
     assert artists[0].name == 'test artist', artists[0]
Esempio n. 5
0
File: db.py Progetto: Robbt/uykfe
 def test_create_local_artist(self):
     delete_db(dir=TEST_DIR)
     session_factory = open_db(dir=TEST_DIR)
     session = session_factory()
     artist = LocalArtist('test artist')
     session.add(artist)
     assert not artist.id
     session.commit()
     assert artist.id
     session.close()
     session = session_factory()
     assert session.query(LocalArtist).count()
     artists = session.query(LocalArtist).all()
     assert len(artists) == 1, artists
     assert artists[0].name == 'test artist', artists[0]
Esempio n. 6
0
 def test_scan_mp3s(self):
     basicConfig(level=DEBUG)
     delete_db(dir=TEST_DIR)
     session = open_db(dir=TEST_DIR)()
     artist = LocalArtist(name='test artist')
     session.add(artist)
     track = LocalTrack(name='test track',
                        url='test url',
                        local_artist=artist.id)
     session.add(track)
     session.flush()
     assert session.query(LocalTrack).filter(
         LocalTrack.url == track.url).count() == 1
     scan_dirs(session, ['/home/andrew/projects/personal/uykfe/data'])
     assert session.query(LocalTrack).filter(
         LocalTrack.url == track.url).count() == 0