# pylint: disable=redefined-outer-name,invalid-name,redefined-builtin, # pylint: disable=too-many-arguments import pytest from dapd_db_schema.schemas.workflow import ( Album, Artist, ArtistAlbum, Playlist, PlaylistTrack, Storefront, Track, TrackAlbum, TrackArtist, ) from dapd_public_api_scraper.const import INSERT_BATCH_SIZE_DEFAULT_VALUE from dapd_public_api_scraper.service.workflowdb import apple_music, spotify @pytest.fixture(scope='function') def apple_music_workflowdb_playlist(logger, db): yield apple_music.AppleMusicPlaylist(logger, db, INSERT_BATCH_SIZE_DEFAULT_VALUE, None) @pytest.fixture(scope='function') def apple_music_workflowdb_track(logger, db): yield apple_music.AppleMusicTrack(logger, db, INSERT_BATCH_SIZE_DEFAULT_VALUE, None) @pytest.fixture(scope='function') def apple_music_workflowdb_artist(logger, db): yield apple_music.AppleMusicArtist(logger, db, INSERT_BATCH_SIZE_DEFAULT_VALUE, None) @pytest.fixture(scope='function') def apple_music_workflowdb_album(logger, db): yield apple_music.AppleMusicAlbum(logger, db, INSERT_BATCH_SIZE_DEFAULT_VALUE, None) @pytest.fixture(scope='function') def spotify_workflowdb_playlist(logger, db): yield spotify.SpotifyPlaylist(logger, db, INSERT_BATCH_SIZE_DEFAULT_VALUE, None) @pytest.fixture(scope='function') def spotify_workflowdb_track(logger, db): yield spotify.SpotifyTrack(logger, db, INSERT_BATCH_SIZE_DEFAULT_VALUE, None) @pytest.fixture(scope='function') def spotify_workflowdb_artist(logger, db): yield spotify.SpotifyArtist(logger, db, INSERT_BATCH_SIZE_DEFAULT_VALUE, None) @pytest.fixture(scope='function') def spotify_workflowdb_album(logger, db): yield spotify.SpotifyAlbum(logger, db, INSERT_BATCH_SIZE_DEFAULT_VALUE, None) @pytest.fixture(scope='function', autouse=True) def clean_db(db): yield for model in [ PlaylistTrack, TrackAlbum, TrackArtist, ArtistAlbum, Playlist, Track, Album, Artist, Storefront, ]: db.session.query(model).delete() db.session.commit()