mirror of
https://github.com/nathom/streamrip.git
synced 2025-06-04 17:03:48 -04:00
Formatting
This commit is contained in:
parent
cf770892f1
commit
abb37f17fd
25 changed files with 181 additions and 78 deletions
2
tests/fixtures/clients.py
vendored
2
tests/fixtures/clients.py
vendored
|
@ -13,7 +13,7 @@ def qobuz_client():
|
|||
config = Config.defaults()
|
||||
config.session.qobuz.email_or_userid = os.environ["QOBUZ_EMAIL"]
|
||||
config.session.qobuz.password_or_token = hashlib.md5(
|
||||
os.environ["QOBUZ_PASSWORD"].encode("utf-8")
|
||||
os.environ["QOBUZ_PASSWORD"].encode("utf-8"),
|
||||
).hexdigest()
|
||||
if "QOBUZ_APP_ID" in os.environ and "QOBUZ_SECRETS" in os.environ:
|
||||
config.session.qobuz.app_id = os.environ["QOBUZ_APP_ID"]
|
||||
|
|
4
tests/fixtures/config.py
vendored
4
tests/fixtures/config.py
vendored
|
@ -6,11 +6,11 @@ import pytest
|
|||
from streamrip.config import Config
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@pytest.fixture()
|
||||
def config():
|
||||
c = Config.defaults()
|
||||
c.session.qobuz.email_or_userid = os.environ["QOBUZ_EMAIL"]
|
||||
c.session.qobuz.password_or_token = hashlib.md5(
|
||||
os.environ["QOBUZ_PASSWORD"].encode("utf-8")
|
||||
os.environ["QOBUZ_PASSWORD"].encode("utf-8"),
|
||||
).hexdigest()
|
||||
return c
|
||||
|
|
|
@ -8,7 +8,7 @@ SAMPLE_CONFIG = "tests/test_config.toml"
|
|||
|
||||
|
||||
# Define a fixture to create a sample ConfigData instance for testing
|
||||
@pytest.fixture
|
||||
@pytest.fixture()
|
||||
def sample_config_data() -> ConfigData:
|
||||
# Create a sample ConfigData instance here
|
||||
# You can customize this to your specific needs for testing
|
||||
|
@ -18,7 +18,7 @@ def sample_config_data() -> ConfigData:
|
|||
|
||||
|
||||
# Define a fixture to create a sample Config instance for testing
|
||||
@pytest.fixture
|
||||
@pytest.fixture()
|
||||
def sample_config() -> Config:
|
||||
# Create a sample Config instance here
|
||||
# You can customize this to your specific needs for testing
|
||||
|
@ -66,10 +66,15 @@ def test_sample_config_data_fields(sample_config_data):
|
|||
download_videos=True,
|
||||
),
|
||||
deezer=DeezerConfig(
|
||||
arl="testarl", quality=2, use_deezloader=True, deezloader_warnings=True
|
||||
arl="testarl",
|
||||
quality=2,
|
||||
use_deezloader=True,
|
||||
deezloader_warnings=True,
|
||||
),
|
||||
soundcloud=SoundcloudConfig(
|
||||
client_id="clientid", app_version="appversion", quality=0
|
||||
client_id="clientid",
|
||||
app_version="appversion",
|
||||
quality=0,
|
||||
),
|
||||
youtube=YoutubeConfig(
|
||||
video_downloads_folder="videodownloadsfolder",
|
||||
|
@ -92,7 +97,9 @@ def test_sample_config_data_fields(sample_config_data):
|
|||
saved_max_width=-1,
|
||||
),
|
||||
metadata=MetadataConfig(
|
||||
set_playlist_to_album=True, renumber_playlist_tracks=True, exclude=[]
|
||||
set_playlist_to_album=True,
|
||||
renumber_playlist_tracks=True,
|
||||
exclude=[],
|
||||
),
|
||||
qobuz_filters=QobuzDiscographyFilterConfig(
|
||||
extras=False,
|
||||
|
|
|
@ -4,14 +4,14 @@ import tomlkit
|
|||
from streamrip.config import *
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@pytest.fixture()
|
||||
def toml():
|
||||
with open("streamrip/config.toml") as f:
|
||||
t = tomlkit.parse(f.read()) # type: ignore
|
||||
return t
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@pytest.fixture()
|
||||
def config():
|
||||
return ConfigData.defaults()
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ import pytest
|
|||
from streamrip.metadata import Covers
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@pytest.fixture()
|
||||
def covers_all():
|
||||
c = Covers()
|
||||
c.set_cover("original", "ourl", None)
|
||||
|
@ -14,19 +14,19 @@ def covers_all():
|
|||
return c
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@pytest.fixture()
|
||||
def covers_none():
|
||||
return Covers()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@pytest.fixture()
|
||||
def covers_one():
|
||||
c = Covers()
|
||||
c.set_cover("small", "surl", None)
|
||||
return c
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@pytest.fixture()
|
||||
def covers_some():
|
||||
c = Covers()
|
||||
c.set_cover("large", "lurl", None)
|
||||
|
|
|
@ -11,8 +11,7 @@ from streamrip.qobuz_client import QobuzClient
|
|||
logger = logging.getLogger("streamrip")
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("qobuz_client")
|
||||
@pytest.fixture
|
||||
@pytest.fixture()
|
||||
def client(qobuz_client):
|
||||
return qobuz_client
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ def wipe_test_flac():
|
|||
audio.save()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@pytest.fixture()
|
||||
def sample_metadata() -> TrackMetadata:
|
||||
return TrackMetadata(
|
||||
TrackInfo(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue