Compare commits
No commits in common. "206a02214e1c28e8f99ac2450620cd634f56a9d7" and "ad391aedc6302f78cb6726c747338daa9c7f860b" have entirely different histories.
206a02214e
...
ad391aedc6
@ -428,6 +428,7 @@ def tracks_filtered(filter: Filter) -> list[TrackDTO]:
|
|||||||
last_played = record.playdates[0].lastplayed
|
last_played = record.playdates[0].lastplayed
|
||||||
else:
|
else:
|
||||||
last_played = None
|
last_played = None
|
||||||
|
last_played
|
||||||
dto = TrackDTO(
|
dto = TrackDTO(
|
||||||
artist=record.artist,
|
artist=record.artist,
|
||||||
bitrate=record.bitrate,
|
bitrate=record.bitrate,
|
||||||
|
|||||||
@ -39,7 +39,6 @@ class FadeGraphGenerator(QObject):
|
|||||||
self.task_completed.emit()
|
self.task_completed.emit()
|
||||||
|
|
||||||
|
|
||||||
@singleton
|
|
||||||
class FadegraphThreadController(QObject):
|
class FadegraphThreadController(QObject):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import unittest
|
|||||||
# App imports
|
# App imports
|
||||||
from app import playlistmodel
|
from app import playlistmodel
|
||||||
from app import ds
|
from app import ds
|
||||||
|
from dbmanager import db
|
||||||
from classes import PlaylistDTO
|
from classes import PlaylistDTO
|
||||||
from helpers import get_all_track_metadata
|
from helpers import get_all_track_metadata
|
||||||
from playlistmodel import PlaylistModel
|
from playlistmodel import PlaylistModel
|
||||||
@ -34,7 +35,7 @@ class MyTestCase(unittest.TestCase):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
"""Runs before each test"""
|
"""Runs before each test"""
|
||||||
|
|
||||||
ds.db.create_all()
|
db.create_all()
|
||||||
|
|
||||||
def playlist_create_and_model(
|
def playlist_create_and_model(
|
||||||
self, playlist_name: str
|
self, playlist_name: str
|
||||||
@ -90,7 +91,7 @@ class MyTestCase(unittest.TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
"""Runs after each test"""
|
"""Runs after each test"""
|
||||||
|
|
||||||
ds.db.drop_all()
|
db.drop_all()
|
||||||
|
|
||||||
def test_add_track_to_header(self):
|
def test_add_track_to_header(self):
|
||||||
"""Add a track to a header row"""
|
"""Add a track to a header row"""
|
||||||
|
|||||||
@ -21,6 +21,7 @@ from pytestqt.plugin import QtBot # type: ignore
|
|||||||
|
|
||||||
# App imports
|
# App imports
|
||||||
from app import ds, musicmuster
|
from app import ds, musicmuster
|
||||||
|
from dbmanager import db
|
||||||
from config import Config
|
from config import Config
|
||||||
from file_importer import FileImporter
|
from file_importer import FileImporter
|
||||||
|
|
||||||
@ -45,7 +46,7 @@ class MyTestCase(unittest.TestCase):
|
|||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
"""Runs once before any test in this class"""
|
"""Runs once before any test in this class"""
|
||||||
|
|
||||||
ds.db.create_all()
|
db.create_all()
|
||||||
|
|
||||||
cls.widget = musicmuster.Window()
|
cls.widget = musicmuster.Window()
|
||||||
|
|
||||||
@ -64,7 +65,7 @@ class MyTestCase(unittest.TestCase):
|
|||||||
def tearDownClass(cls):
|
def tearDownClass(cls):
|
||||||
"""Runs once after all tests"""
|
"""Runs once after all tests"""
|
||||||
|
|
||||||
ds.db.drop_all()
|
db.drop_all()
|
||||||
shutil.rmtree(cls.musicstore)
|
shutil.rmtree(cls.musicstore)
|
||||||
shutil.rmtree(cls.import_source)
|
shutil.rmtree(cls.import_source)
|
||||||
|
|
||||||
|
|||||||
@ -7,15 +7,16 @@ import unittest
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
# App imports
|
# App imports
|
||||||
|
from dbmanager import db
|
||||||
import ds
|
import ds
|
||||||
|
|
||||||
|
|
||||||
class TestMMMisc(unittest.TestCase):
|
class TestMMMisc(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
ds.db.create_all()
|
db.create_all()
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
ds.db.drop_all()
|
db.drop_all()
|
||||||
|
|
||||||
def test_log_exception(self):
|
def test_log_exception(self):
|
||||||
"""Test deliberate exception"""
|
"""Test deliberate exception"""
|
||||||
|
|||||||
@ -9,6 +9,7 @@ from PyQt6.QtCore import Qt, QModelIndex
|
|||||||
# App imports
|
# App imports
|
||||||
from app.helpers import get_all_track_metadata
|
from app.helpers import get_all_track_metadata
|
||||||
from app import ds, playlistmodel
|
from app import ds, playlistmodel
|
||||||
|
from dbmanager import db
|
||||||
from classes import (
|
from classes import (
|
||||||
InsertTrack,
|
InsertTrack,
|
||||||
TrackAndPlaylist,
|
TrackAndPlaylist,
|
||||||
@ -29,7 +30,7 @@ class TestMMMiscTracks(unittest.TestCase):
|
|||||||
"testdata/wrb.flac",
|
"testdata/wrb.flac",
|
||||||
]
|
]
|
||||||
|
|
||||||
ds.db.create_all()
|
db.create_all()
|
||||||
|
|
||||||
# Create a playlist and model
|
# Create a playlist and model
|
||||||
self.playlist = ds.playlist_create(PLAYLIST_NAME, template_id=0)
|
self.playlist = ds.playlist_create(PLAYLIST_NAME, template_id=0)
|
||||||
@ -50,7 +51,7 @@ class TestMMMiscTracks(unittest.TestCase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
ds.db.drop_all()
|
db.drop_all()
|
||||||
|
|
||||||
def test_8_row_playlist(self):
|
def test_8_row_playlist(self):
|
||||||
# Test auto-created playlist
|
# Test auto-created playlist
|
||||||
@ -97,10 +98,10 @@ class TestMMMiscNoPlaylist(unittest.TestCase):
|
|||||||
]
|
]
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
ds.db.create_all()
|
db.create_all()
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
ds.db.drop_all()
|
db.drop_all()
|
||||||
|
|
||||||
def test_insert_track_new_playlist(self):
|
def test_insert_track_new_playlist(self):
|
||||||
# insert a track into a new playlist
|
# insert a track into a new playlist
|
||||||
@ -136,7 +137,7 @@ class TestMMMiscRowMove(unittest.TestCase):
|
|||||||
ROWS_TO_CREATE = 11
|
ROWS_TO_CREATE = 11
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
ds.db.create_all()
|
db.create_all()
|
||||||
|
|
||||||
self.playlist = ds.playlist_create(self.PLAYLIST_NAME, template_id=0)
|
self.playlist = ds.playlist_create(self.PLAYLIST_NAME, template_id=0)
|
||||||
self.model = playlistmodel.PlaylistModel(
|
self.model = playlistmodel.PlaylistModel(
|
||||||
@ -152,7 +153,7 @@ class TestMMMiscRowMove(unittest.TestCase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
ds.db.drop_all()
|
db.drop_all()
|
||||||
|
|
||||||
def test_insert_header_row_end(self):
|
def test_insert_header_row_end(self):
|
||||||
# insert header row at end of playlist
|
# insert header row at end of playlist
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import unittest
|
|||||||
# Third party imports
|
# Third party imports
|
||||||
|
|
||||||
# App imports
|
# App imports
|
||||||
|
from dbmanager import db
|
||||||
from classes import (
|
from classes import (
|
||||||
Filter,
|
Filter,
|
||||||
)
|
)
|
||||||
@ -19,7 +20,7 @@ class MyTestCase(unittest.TestCase):
|
|||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
"""Runs once before any test in this class"""
|
"""Runs once before any test in this class"""
|
||||||
|
|
||||||
ds.db.create_all()
|
db.create_all()
|
||||||
|
|
||||||
# Create some track entries
|
# Create some track entries
|
||||||
track1_meta = dict(
|
track1_meta = dict(
|
||||||
@ -54,7 +55,7 @@ class MyTestCase(unittest.TestCase):
|
|||||||
def tearDownClass(cls):
|
def tearDownClass(cls):
|
||||||
"""Runs once after all tests"""
|
"""Runs once after all tests"""
|
||||||
|
|
||||||
ds.db.drop_all()
|
db.drop_all()
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
"""Runs before each test"""
|
"""Runs before each test"""
|
||||||
|
|||||||
@ -10,6 +10,7 @@ from pytestqt.plugin import QtBot # type: ignore
|
|||||||
|
|
||||||
# App imports
|
# App imports
|
||||||
from app import playlistmodel, utilities
|
from app import playlistmodel, utilities
|
||||||
|
from dbmanager import db
|
||||||
from app import ds, musicmuster
|
from app import ds, musicmuster
|
||||||
from classes import InsertTrack
|
from classes import InsertTrack
|
||||||
|
|
||||||
@ -40,7 +41,7 @@ def with_updown(function):
|
|||||||
@pytest.mark.usefixtures("qtbot_adapter")
|
@pytest.mark.usefixtures("qtbot_adapter")
|
||||||
class MyTestCase(unittest.TestCase):
|
class MyTestCase(unittest.TestCase):
|
||||||
def up(self):
|
def up(self):
|
||||||
ds.db.create_all()
|
db.create_all()
|
||||||
self.widget = musicmuster.Window()
|
self.widget = musicmuster.Window()
|
||||||
# self.widget.show()
|
# self.widget.show()
|
||||||
|
|
||||||
@ -71,7 +72,7 @@ class MyTestCase(unittest.TestCase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def down(self):
|
def down(self):
|
||||||
ds.db.drop_all()
|
db.drop_all()
|
||||||
|
|
||||||
@with_updown
|
@with_updown
|
||||||
def test_init(self):
|
def test_init(self):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user