curds: Rename curds/tags/ -> curds/trak/
The "tags" name doesn't really fit anymore now that we removed the Album class. Let's change the name to something more accurate. Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
parent
824e68dc94
commit
5f079d6a58
|
@ -2,11 +2,11 @@
|
|||
from . import data
|
||||
from . import notify
|
||||
from . import playlist
|
||||
from . import tags
|
||||
from . import threadqueue
|
||||
from . import trak
|
||||
import os
|
||||
|
||||
tags.map.load()
|
||||
trak.map.load()
|
||||
playlist.load()
|
||||
if os.environ.get("EMMENTAL_TESTING"):
|
||||
playlist.reset()
|
||||
|
@ -14,12 +14,12 @@ if os.environ.get("EMMENTAL_TESTING"):
|
|||
DataFile = data.DataFile
|
||||
Playlist = playlist.playlist.Playlist
|
||||
ThreadQueue = threadqueue.ThreadQueue
|
||||
Track = tags.track.Track
|
||||
Track = trak.track.Track
|
||||
|
||||
|
||||
def reset():
|
||||
notify.clear()
|
||||
tags.map.clear()
|
||||
trak.map.clear()
|
||||
playlist.reset()
|
||||
|
||||
def stop():
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
from . import node
|
||||
from . import playlist
|
||||
from .. import notify
|
||||
from .. import tags
|
||||
from .. import threadqueue
|
||||
from .. import trak
|
||||
import os
|
||||
|
||||
LIBRARY_ICON = "folder-music"
|
||||
|
@ -18,10 +18,10 @@ class LibraryPlaylist(playlist.Playlist):
|
|||
return key.strip("/").split("/")
|
||||
|
||||
def thread_add(self, path):
|
||||
self.add(tags.track.lookup(path))
|
||||
self.add(trak.track.lookup(path))
|
||||
|
||||
def thread_save(self):
|
||||
tags.map.save()
|
||||
trak.map.save()
|
||||
notify.notify("save-data")
|
||||
|
||||
def thread_scan(self):
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
from . import node
|
||||
from .. import notify
|
||||
from .. import sort
|
||||
from .. import tags
|
||||
from .. import trak
|
||||
import random
|
||||
|
||||
class Playlist(node.PlaylistNode):
|
||||
|
@ -35,7 +35,7 @@ class Playlist(node.PlaylistNode):
|
|||
|
||||
def __setstate__(self, state):
|
||||
node.PlaylistNode.__setstate__(self, state)
|
||||
self.list = [ tags.map.get(hash) for hash in state["list"] ]
|
||||
self.list = [ trak.map.get(hash) for hash in state["list"] ]
|
||||
self.sort_order = state["sort_order"]
|
||||
self.current = state["current"]
|
||||
self.can_loop = state["can_loop"]
|
||||
|
|
|
@ -9,7 +9,7 @@ from . import previous
|
|||
from . import up_next
|
||||
from . import user
|
||||
from .. import notify
|
||||
from .. import tags
|
||||
from .. import trak
|
||||
import random
|
||||
|
||||
|
||||
|
@ -39,7 +39,7 @@ class PlaylistRoot(node.PlaylistNode):
|
|||
node.PlaylistNode.__setstate__(self, state)
|
||||
self.current = state["current"]
|
||||
self.track = state["track"]
|
||||
self.track = tags.map.get(state["track"]) if self.track else None
|
||||
self.track = trak.map.get(state["track"]) if self.track else None
|
||||
|
||||
def current_changed(self, old):
|
||||
if old != self.current[0]:
|
||||
|
|
|
@ -3,7 +3,7 @@ from . import artist
|
|||
from . import node
|
||||
from . import playlist
|
||||
from .. import notify
|
||||
from .. import tags
|
||||
from .. import trak
|
||||
import os
|
||||
import unittest
|
||||
|
||||
|
@ -12,7 +12,7 @@ test_album = os.path.join("./trier/Test Library/Test Artist 01/Test Album 1")
|
|||
class TestArtistPlaylist(unittest.TestCase):
|
||||
def setUp(self):
|
||||
notify.clear()
|
||||
tags.map.clear()
|
||||
trak.map.clear()
|
||||
|
||||
def test_artist_node(self):
|
||||
anode = artist.ArtistNode()
|
||||
|
@ -32,7 +32,7 @@ class TestArtistPlaylist(unittest.TestCase):
|
|||
anode = artist.ArtistNode()
|
||||
self.assertEqual(anode.n_children(), 0)
|
||||
|
||||
track = tags.track.lookup(os.path.join(test_album, "01 - Test Track 01.ogg"))
|
||||
track = trak.track.lookup(os.path.join(test_album, "01 - Test Track 01.ogg"))
|
||||
self.assertEqual(anode.n_children(), 1)
|
||||
plist = anode.nth_child(0)
|
||||
self.assertEqual(plist.name, "Test Artist 01")
|
||||
|
@ -59,7 +59,7 @@ class TestArtistPlaylist(unittest.TestCase):
|
|||
|
||||
def test_artist_playlist_add(self):
|
||||
anode = artist.ArtistNode()
|
||||
track = tags.track.lookup(os.path.join(test_album, "01 - Test Track 01.ogg"))
|
||||
track = trak.track.lookup(os.path.join(test_album, "01 - Test Track 01.ogg"))
|
||||
plist = anode.nth_child(0)
|
||||
|
||||
self.assertEqual(plist.n_children(), 1)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
from . import collection
|
||||
from . import playlist
|
||||
from .. import notify
|
||||
from .. import tags
|
||||
from .. import trak
|
||||
import os
|
||||
import unittest
|
||||
|
||||
|
@ -23,7 +23,7 @@ class TestCollectionPlaylist(unittest.TestCase):
|
|||
plist = collection.CollectionPlaylist()
|
||||
self.assertEqual(len(plist), 0)
|
||||
|
||||
track1 = tags.track.lookup(os.path.join(test_album, "01 - Test Track.ogg"))
|
||||
track1 = trak.track.lookup(os.path.join(test_album, "01 - Test Track.ogg"))
|
||||
self.assertEqual(len(plist), 1)
|
||||
self.assertEqual(plist[0], track1)
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ from . import decade
|
|||
from . import node
|
||||
from . import playlist
|
||||
from .. import notify
|
||||
from .. import tags
|
||||
from .. import trak
|
||||
import os
|
||||
import unittest
|
||||
|
||||
|
@ -15,7 +15,7 @@ test_album3 = os.path.join("Test Album 4", "02 - Test Track 02.ogg")
|
|||
class TestDecadePlaylist(unittest.TestCase):
|
||||
def setUp(self):
|
||||
notify.clear()
|
||||
tags.map.clear()
|
||||
trak.map.clear()
|
||||
|
||||
def test_decade(self):
|
||||
self.assertEqual(decade.decade( 1971), "1970s")
|
||||
|
@ -41,7 +41,7 @@ class TestDecadePlaylist(unittest.TestCase):
|
|||
dnode = decade.DecadeNode()
|
||||
self.assertEqual(dnode.n_children(), 0)
|
||||
|
||||
track = tags.track.lookup(os.path.join(test_library, test_album))
|
||||
track = trak.track.lookup(os.path.join(test_library, test_album))
|
||||
self.assertEqual(dnode.n_children(), 1)
|
||||
plist = dnode.nth_child(0)
|
||||
self.assertEqual(plist.name, "1970s")
|
||||
|
@ -69,7 +69,7 @@ class TestDecadePlaylist(unittest.TestCase):
|
|||
|
||||
def test_decade_playlist_add(self):
|
||||
dnode = decade.DecadeNode()
|
||||
track = tags.track.lookup(os.path.join(test_library, test_album))
|
||||
track = trak.track.lookup(os.path.join(test_library, test_album))
|
||||
plist = dnode.nth_child(0)
|
||||
|
||||
self.assertEqual(plist.n_children(), 1)
|
||||
|
|
|
@ -3,7 +3,7 @@ from . import genre
|
|||
from . import node
|
||||
from . import playlist
|
||||
from .. import notify
|
||||
from .. import tags
|
||||
from .. import trak
|
||||
import os
|
||||
import unittest
|
||||
|
||||
|
@ -12,7 +12,7 @@ test_library = os.path.abspath("./trier/Test Library/Test Artist 01")
|
|||
class TestGenrePlaylist(unittest.TestCase):
|
||||
def setUp(self):
|
||||
notify.clear()
|
||||
tags.map.clear()
|
||||
trak.map.clear()
|
||||
|
||||
def test_genre_node(self):
|
||||
gnode = genre.GenreNode()
|
||||
|
@ -22,7 +22,7 @@ class TestGenrePlaylist(unittest.TestCase):
|
|||
|
||||
def test_genre_playlist(self):
|
||||
gnode = genre.GenreNode()
|
||||
track = tags.track.lookup(os.path.join(test_library, "Test Album 1",
|
||||
track = trak.track.lookup(os.path.join(test_library, "Test Album 1",
|
||||
"01 - Test Track 01.ogg"))
|
||||
self.assertEqual(gnode.n_children(), 1)
|
||||
|
||||
|
@ -42,11 +42,11 @@ class TestGenrePlaylist(unittest.TestCase):
|
|||
|
||||
def test_genre_new_tracks(self):
|
||||
gnode = genre.GenreNode()
|
||||
track1 = tags.track.lookup(os.path.join(test_library, "Test Album 1",
|
||||
track1 = trak.track.lookup(os.path.join(test_library, "Test Album 1",
|
||||
"01 - Test Track 01.ogg"))
|
||||
track2 = tags.track.lookup(os.path.join(test_library, "Test Album 2",
|
||||
track2 = trak.track.lookup(os.path.join(test_library, "Test Album 2",
|
||||
"02 - Test Track 02.ogg"))
|
||||
track3 = tags.track.lookup(os.path.join(test_library, "Test Album 2",
|
||||
track3 = trak.track.lookup(os.path.join(test_library, "Test Album 2",
|
||||
"03 - Test Track 03.ogg"))
|
||||
self.assertEqual(gnode.n_children(), 2)
|
||||
|
||||
|
|
|
@ -3,8 +3,8 @@ from . import library
|
|||
from . import node
|
||||
from . import playlist
|
||||
from .. import notify
|
||||
from .. import tags
|
||||
from .. import threadqueue
|
||||
from .. import trak
|
||||
import os
|
||||
import time
|
||||
import unittest
|
||||
|
@ -15,8 +15,8 @@ test_album = os.path.abspath("./trier/Test Album")
|
|||
class TestLibraryPlaylist(unittest.TestCase):
|
||||
def setUp(self):
|
||||
library.reset()
|
||||
tags.map.clear()
|
||||
tags.map.remove()
|
||||
trak.map.clear()
|
||||
trak.map.remove()
|
||||
notify.clear()
|
||||
|
||||
def tearDownClass():
|
||||
|
@ -41,7 +41,7 @@ class TestLibraryPlaylist(unittest.TestCase):
|
|||
|
||||
def test_library_lookup(self):
|
||||
lnode = library.LibraryNode()
|
||||
self.assertFalse(tags.map.exists())
|
||||
self.assertFalse(trak.map.exists())
|
||||
|
||||
plist = lnode.lookup(test_library)
|
||||
self.assertEqual(lnode.n_children(), 1)
|
||||
|
@ -49,7 +49,7 @@ class TestLibraryPlaylist(unittest.TestCase):
|
|||
library.join()
|
||||
self.assertEqual(len(plist), 1250)
|
||||
self.assertEqual(lnode.lookup(test_library + "/"), plist)
|
||||
self.assertTrue(tags.map.exists())
|
||||
self.assertTrue(trak.map.exists())
|
||||
|
||||
plist = lnode.lookup(test_album)
|
||||
self.assertEqual(lnode.n_children(), 2)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Copyright 2019 (c) Anna Schumaker.
|
||||
from . import new
|
||||
from . import playlist
|
||||
from .. import tags
|
||||
from .. import trak
|
||||
import os
|
||||
import unittest
|
||||
|
||||
|
@ -20,13 +20,13 @@ class TestNewPlaylist(unittest.TestCase):
|
|||
plist = new.NewPlaylist()
|
||||
self.assertEqual(len(plist), 0)
|
||||
|
||||
track = tags.track.lookup(os.path.join(test_album, "01 - Test Track.ogg"))
|
||||
track = trak.track.lookup(os.path.join(test_album, "01 - Test Track.ogg"))
|
||||
self.assertEqual(len(plist), 1)
|
||||
self.assertEqual(plist[0], track)
|
||||
|
||||
def test_new_plist_get_state(self):
|
||||
plist = new.NewPlaylist()
|
||||
track = tags.track.lookup(os.path.join(test_album, "01 - Test Track 01.ogg"))
|
||||
track = trak.track.lookup(os.path.join(test_album, "01 - Test Track 01.ogg"))
|
||||
|
||||
plist.add(track)
|
||||
plist.current = 3
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
from . import node
|
||||
from . import playlist
|
||||
from .. import notify
|
||||
from .. import tags
|
||||
from .. import trak
|
||||
import os
|
||||
import random
|
||||
import unittest
|
||||
|
@ -12,7 +12,7 @@ test_album = os.path.join(test_library, "Test Artist 01", "Test Album 1")
|
|||
|
||||
class TestPlaylist(unittest.TestCase):
|
||||
def setUp(self):
|
||||
tags.map.clear()
|
||||
trak.map.clear()
|
||||
notify.register("add-track", self.on_add_remove)
|
||||
notify.register("remove-track", self.on_add_remove)
|
||||
notify.register("playlist-changed", self.on_plist_changed)
|
||||
|
@ -30,7 +30,7 @@ class TestPlaylist(unittest.TestCase):
|
|||
tracks = [ ]
|
||||
for t in tracknos:
|
||||
path = os.path.join(test_album, f"{t:02} - Test Track {t:02}.ogg")
|
||||
tracks.append(tags.track.lookup(path))
|
||||
tracks.append(trak.track.lookup(path))
|
||||
self.plist.add(tracks[-1])
|
||||
return tracks
|
||||
|
||||
|
@ -137,7 +137,7 @@ class TestPlaylist(unittest.TestCase):
|
|||
for track in tracks:
|
||||
self.assertTrue(self.plist.contains(track))
|
||||
|
||||
track = tags.track.lookup(os.path.join(test_album, f"10 - Test Track 10.ogg"))
|
||||
track = trak.track.lookup(os.path.join(test_album, f"10 - Test Track 10.ogg"))
|
||||
self.assertFalse(self.plist.contains(track))
|
||||
|
||||
def test_playlist_index(self):
|
||||
|
@ -145,7 +145,7 @@ class TestPlaylist(unittest.TestCase):
|
|||
for i, track in enumerate(tracks):
|
||||
self.assertEqual(self.plist.index(track), i)
|
||||
|
||||
track = tags.track.lookup(os.path.join(test_album, f"10 - Test Track 10.ogg"))
|
||||
track = trak.track.lookup(os.path.join(test_album, f"10 - Test Track 10.ogg"))
|
||||
self.assertIsNone(self.plist.index(track))
|
||||
self.assertIsNone(self.plist.index(None))
|
||||
|
||||
|
@ -155,7 +155,7 @@ class TestPlaylist(unittest.TestCase):
|
|||
for i, track in enumerate(tracks):
|
||||
self.assertEqual(self.plist.index(track), i)
|
||||
|
||||
track = tags.track.lookup(os.path.join(test_album, f"10 - Test Track 10.ogg"))
|
||||
track = trak.track.lookup(os.path.join(test_album, f"10 - Test Track 10.ogg"))
|
||||
self.assertIsNone(self.plist.index(track))
|
||||
self.assertIsNone(self.plist.index(None))
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
from . import playlist
|
||||
from . import previous
|
||||
from .. import notify
|
||||
from .. import tags
|
||||
from .. import trak
|
||||
import os
|
||||
import unittest
|
||||
|
||||
|
@ -33,7 +33,7 @@ class TestPreviousPlaylist(unittest.TestCase):
|
|||
|
||||
def test_previous_getstate(self):
|
||||
plist = previous.PreviousPlaylist()
|
||||
track = tags.track.lookup(os.path.join(test_album, "01 - Test Track 01.ogg"))
|
||||
track = trak.track.lookup(os.path.join(test_album, "01 - Test Track 01.ogg"))
|
||||
|
||||
plist.add(track)
|
||||
plist.current = 3
|
||||
|
@ -48,9 +48,9 @@ class TestPreviousPlaylist(unittest.TestCase):
|
|||
plist = previous.PreviousPlaylist()
|
||||
plist.visible = True
|
||||
|
||||
track1 = tags.track.lookup(os.path.join(test_album, "01 - Test Track 01.ogg"))
|
||||
track2 = tags.track.lookup(os.path.join(test_album, "02 - Test Track 02.ogg"))
|
||||
track3 = tags.track.lookup(os.path.join(test_album, "03 - Test Track 03.ogg"))
|
||||
track1 = trak.track.lookup(os.path.join(test_album, "01 - Test Track 01.ogg"))
|
||||
track2 = trak.track.lookup(os.path.join(test_album, "02 - Test Track 02.ogg"))
|
||||
track3 = trak.track.lookup(os.path.join(test_album, "03 - Test Track 03.ogg"))
|
||||
|
||||
self.assertEqual(plist.current, -1)
|
||||
self.assertEqual(plist.next(), None)
|
||||
|
|
|
@ -11,8 +11,8 @@ from . import root
|
|||
from . import up_next
|
||||
from . import user
|
||||
from .. import notify
|
||||
from .. import tags
|
||||
from .. import threadqueue
|
||||
from .. import trak
|
||||
import os
|
||||
import random
|
||||
import unittest
|
||||
|
@ -22,7 +22,7 @@ test_library = os.path.abspath("./trier/Test Library")
|
|||
|
||||
class TestPlaylistRoot(unittest.TestCase):
|
||||
def setUp(self):
|
||||
tags.map.clear()
|
||||
trak.map.clear()
|
||||
library.reset()
|
||||
notify.register("next-track", self.on_next_track)
|
||||
notify.register("playlist-changed", self.on_playlist_changed)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Copyright 2019 (c) Anna Schumaker.
|
||||
from .. import notify
|
||||
from .. import tags
|
||||
from .. import trak
|
||||
from . import up_next
|
||||
import os
|
||||
import unittest
|
||||
|
@ -26,7 +26,7 @@ class TestUpNextPlaylist(unittest.TestCase):
|
|||
tracks = [ ]
|
||||
for i in range(1, 4,):
|
||||
path = os.path.join(test_album, f"0{i} - Test Track 0{i}.ogg")
|
||||
tracks.append(tags.track.lookup(path))
|
||||
tracks.append(trak.track.lookup(path))
|
||||
plist.add(tracks[-1])
|
||||
return tracks
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ from . import new
|
|||
from . import node
|
||||
from . import user
|
||||
from .. import notify
|
||||
from .. import tags
|
||||
from .. import trak
|
||||
import unittest
|
||||
|
||||
class TestUserPlaylists(unittest.TestCase):
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Copyright 2019 (c) Anna Schumaker.
|
||||
from . import data
|
||||
from . import tags
|
||||
from . import trak
|
||||
from . import threadqueue
|
||||
import unittest
|
||||
import os
|
||||
|
@ -10,36 +10,36 @@ test_tracks = os.path.abspath("./trier/Test Album")
|
|||
|
||||
class TestTags(unittest.TestCase):
|
||||
def setUp(self):
|
||||
data.DataFile("tags.pickle", data.WRITE).remove()
|
||||
tags.map.clear()
|
||||
tags.map.remove()
|
||||
data.DataFile("tracks.pickle", data.WRITE).remove()
|
||||
trak.map.clear()
|
||||
trak.map.remove()
|
||||
|
||||
def test_tags_stress(self):
|
||||
dfile = data.DataFile("tags.pickle", data.READ)
|
||||
dfile = data.DataFile("tracks.pickle", data.READ)
|
||||
tq = threadqueue.ThreadQueue()
|
||||
tracks = 0
|
||||
|
||||
self.assertFalse(dfile.exists())
|
||||
self.assertEqual(len(tags.map.tag_map), 0)
|
||||
self.assertEqual(len(trak.map.tag_map), 0)
|
||||
|
||||
for dirname, subdirs, files in os.walk(test_library):
|
||||
save = False
|
||||
for f in files:
|
||||
tq.push(tags.track.lookup, os.path.join(dirname, f))
|
||||
tq.push(trak.track.lookup, os.path.join(dirname, f))
|
||||
tracks += 1
|
||||
save = True
|
||||
if save == True:
|
||||
tq.push(tags.map.save)
|
||||
tq.push(trak.map.save)
|
||||
|
||||
self.assertLess(len(tags.map.tag_map), tracks)
|
||||
self.assertLess(len(trak.map.tag_map), tracks)
|
||||
tq.join()
|
||||
tq.stop()
|
||||
self.assertEqual(len(tags.map.tag_map), tracks)
|
||||
self.assertEqual(len(trak.map.tag_map), tracks)
|
||||
self.assertTrue(dfile.exists())
|
||||
tag_list = list(tags.map.tag_map.values())
|
||||
tag_list = list(trak.map.tag_map.values())
|
||||
|
||||
tags.map.clear()
|
||||
tags.map.load()
|
||||
self.assertEqual(len(tags.map.tag_map), tracks)
|
||||
trak.map.clear()
|
||||
trak.map.load()
|
||||
self.assertEqual(len(trak.map.tag_map), tracks)
|
||||
for tag in tag_list:
|
||||
self.assertIn(tag.hash(), tags.map.tag_map)
|
||||
self.assertIn(tag.hash(), trak.map.tag_map)
|
|
@ -4,7 +4,7 @@ from .. import notify
|
|||
import os
|
||||
import threading
|
||||
|
||||
tag_file = "tags.pickle"
|
||||
tag_file = "tracks.pickle"
|
||||
tag_lock = threading.Lock()
|
||||
tag_map = dict()
|
||||
|
|
@ -13,7 +13,7 @@ class TestTag:
|
|||
|
||||
class TestMap(unittest.TestCase):
|
||||
def setUp(self):
|
||||
data.DataFile("tags.pickle", data.WRITE).remove()
|
||||
data.DataFile("tracks.pickle", data.WRITE).remove()
|
||||
map.clear()
|
||||
|
||||
def test_map(self):
|
||||
|
@ -33,7 +33,7 @@ class TestMap(unittest.TestCase):
|
|||
self.assertEqual(map.lookup(b), (False, a))
|
||||
|
||||
def test_map_save_load(self):
|
||||
dfile = data.DataFile("tags.pickle", data.READ)
|
||||
dfile = data.DataFile("tracks.pickle", data.READ)
|
||||
|
||||
self.assertFalse(dfile.exists())
|
||||
self.assertFalse(map.exists())
|
|
@ -19,8 +19,8 @@ class TestNodeTreeModel(unittest.TestCase):
|
|||
self.artist = curds.playlist.lookup("Artists")
|
||||
self.decade = curds.playlist.lookup("Decades")
|
||||
self.genre = curds.playlist.lookup("Genres")
|
||||
curds.tags.track.lookup(os.path.join(test_album1, "01 - Test Track 01.ogg"))
|
||||
curds.tags.track.lookup(os.path.join(test_album2, "01 - Test Track 01.ogg"))
|
||||
curds.trak.track.lookup(os.path.join(test_album1, "01 - Test Track 01.ogg"))
|
||||
curds.trak.track.lookup(os.path.join(test_album2, "01 - Test Track 01.ogg"))
|
||||
|
||||
def tearDown(self):
|
||||
curds.notify.cancel("node-inserted", self.model.on_node_inserted)
|
||||
|
|
|
@ -12,8 +12,8 @@ class TestPlaylistModel(unittest.TestCase):
|
|||
curds.reset()
|
||||
|
||||
self.playlist = curds.Playlist("Test Playlist")
|
||||
self.track1 = curds.tags.track.lookup(os.path.join(test_album, "01 - Test Track 01.ogg"))
|
||||
self.track2 = curds.tags.track.lookup(os.path.join(test_album, "02 - Test Track 02.ogg"))
|
||||
self.track1 = curds.trak.track.lookup(os.path.join(test_album, "01 - Test Track 01.ogg"))
|
||||
self.track2 = curds.trak.track.lookup(os.path.join(test_album, "02 - Test Track 02.ogg"))
|
||||
self.playlist.add(self.track1)
|
||||
self.playlist.add(self.track2)
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ class TestPlaylistView(unittest.TestCase):
|
|||
|
||||
def add_track(self, trackno):
|
||||
path = os.path.join(test_album, f"{trackno:02} - Test Track {trackno:02}.ogg")
|
||||
track = curds.tags.track.lookup(path)
|
||||
track = curds.trak.track.lookup(path)
|
||||
self.plist.add(track)
|
||||
gtk.notify_loop()
|
||||
|
||||
|
@ -155,7 +155,7 @@ class TestPlaylistView(unittest.TestCase):
|
|||
self.row_deleted = 0
|
||||
|
||||
for i in range(1, 11):
|
||||
track = curds.tags.track.lookup(os.path.join(test_album, f"{i:02} - Test Track {i:02}.ogg"))
|
||||
track = curds.trak.track.lookup(os.path.join(test_album, f"{i:02} - Test Track {i:02}.ogg"))
|
||||
self.plist.add(track)
|
||||
gtk.notify_loop()
|
||||
self.assertEqual(self.row_inserted, i)
|
||||
|
|
|
@ -10,7 +10,7 @@ test_album = os.path.abspath("./trier/Test Library/Test Artist 01/Test Album 1")
|
|||
class TestAudio(unittest.TestCase):
|
||||
def test_play_track(self):
|
||||
path = os.path.join(test_album, "01 - Test Track 01.ogg")
|
||||
track = curds.tags.track.lookup(path)
|
||||
track = curds.trak.track.lookup(path)
|
||||
|
||||
self.assertEqual(audio.playbin.get_state(), Gst.State.NULL)
|
||||
audio.play_track(track)
|
||||
|
|
|
@ -8,7 +8,7 @@ class TestEmmental(unittest.TestCase):
|
|||
def test_import_curds(self):
|
||||
self.assertEqual(curds.DataFile, curds.data.DataFile)
|
||||
self.assertEqual(curds.ThreadQueue, curds.threadqueue.ThreadQueue)
|
||||
self.assertEqual(curds.Track, curds.tags.track.Track)
|
||||
self.assertEqual(curds.Track, curds.trak.track.Track)
|
||||
|
||||
self.assertEqual(curds.Playlist, curds.playlist.playlist.Playlist)
|
||||
self.assertEqual(curds.playlist.Library, curds.playlist.library.LibraryPlaylist)
|
||||
|
@ -30,15 +30,15 @@ class TestEmmental(unittest.TestCase):
|
|||
|
||||
def test_reset_stop_curds(self):
|
||||
path = os.path.join("trier", "Test Album", "01 - Test Track.ogg")
|
||||
track = curds.tags.track.lookup(path)
|
||||
track = curds.trak.track.lookup(path)
|
||||
curds.playlist.library.library_thread.stop()
|
||||
|
||||
self.assertIsNotNone(track)
|
||||
self.assertGreater(len(curds.tags.map.tag_map), 0)
|
||||
self.assertGreater(len(curds.trak.map.tag_map), 0)
|
||||
self.assertFalse(curds.playlist.library.library_thread.is_alive())
|
||||
|
||||
curds.reset()
|
||||
self.assertEqual(curds.tags.map.tag_map, {})
|
||||
self.assertEqual(curds.trak.map.tag_map, {})
|
||||
self.assertTrue(curds.playlist.library.library_thread.is_alive())
|
||||
self.assertEqual(len(curds.playlist.lookup("Collection")), 0)
|
||||
self.assertEqual(curds.playlist.lookup("Libraries").n_children(), 0)
|
||||
|
|
Loading…
Reference in New Issue
Block a user