Skip to content

Commit d77a73b

Browse files
committed
Format with latest Black
1 parent 5aa946e commit d77a73b

File tree

6 files changed

+43
-10
lines changed

6 files changed

+43
-10
lines changed

mopidy_spotify/browse.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,8 @@ def _browse_your_music(web_client, variant):
214214

215215
if variant in ("tracks", "albums"):
216216
items = web_client.get_one(
217-
f"me/{variant}", params={"market": "from_token"},
217+
f"me/{variant}",
218+
params={"market": "from_token"},
218219
).get("items", [])
219220
if variant == "tracks":
220221
return list(translator.web_to_track_refs(items))

mopidy_spotify/translator.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,11 @@ def web_to_track_refs(web_tracks, *, check_playable=True):
209209

210210

211211
def to_playlist(
212-
web_playlist, username=None, bitrate=None, as_ref=False, as_items=False,
212+
web_playlist,
213+
username=None,
214+
bitrate=None,
215+
as_ref=False,
216+
as_items=False,
213217
):
214218
ref = to_playlist_ref(web_playlist, username)
215219
if ref is None or as_ref:

mopidy_spotify/web.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ def _refresh_token(self):
142142
self._expires = time.time() + result.get("expires_in", float("Inf"))
143143

144144
if result.get("expires_in"):
145-
logger.debug(f"Token expires in {result['expires_in']} seconds.",)
145+
logger.debug(
146+
f"Token expires in {result['expires_in']} seconds.",
147+
)
146148
if result.get("scope"):
147149
logger.debug(f"Token scopes: {result['scope']}")
148150

tests/test_backend.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ def test_on_start_configures_web_client(spotify_mock, web_mock, config):
130130
backend.on_start()
131131

132132
web_mock.SpotifyOAuthClient.assert_called_once_with(
133-
client_id="1234567", client_secret="AbCdEfG", proxy_config=mock.ANY,
133+
client_id="1234567",
134+
client_secret="AbCdEfG",
135+
proxy_config=mock.ANY,
134136
)
135137

136138

tests/test_distinct.py

+24-4
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,30 @@ def test_get_distinct_without_query_returns_nothing_when_playlists_disabled(
7171
@pytest.mark.parametrize(
7272
"field,query,expected,types",
7373
[
74-
("artist", {"album": ["Foo"]}, {"ABBA"}, ["artist"],),
75-
("albumartist", {"album": ["Foo"]}, {"ABBA"}, ["album"],),
76-
("album", {"artist": ["Bar"]}, {"DEF 456"}, ["album"],),
77-
("date", {"artist": ["Bar"]}, {"2001"}, ["album"],),
74+
(
75+
"artist",
76+
{"album": ["Foo"]},
77+
{"ABBA"},
78+
["artist"],
79+
),
80+
(
81+
"albumartist",
82+
{"album": ["Foo"]},
83+
{"ABBA"},
84+
["album"],
85+
),
86+
(
87+
"album",
88+
{"artist": ["Bar"]},
89+
{"DEF 456"},
90+
["album"],
91+
),
92+
(
93+
"date",
94+
{"artist": ["Bar"]},
95+
{"2001"},
96+
["album"],
97+
),
7898
],
7999
)
80100
def test_get_distinct_with_query(

tests/test_web.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,9 @@ def test_login_fails(self, spotify_client, caplog):
771771
@responses.activate
772772
def test_get_one_error(self, spotify_client, caplog):
773773
responses.add(
774-
responses.GET, self.url("foo"), json={"error": "bar"},
774+
responses.GET,
775+
self.url("foo"),
776+
json={"error": "bar"},
775777
)
776778

777779
result = spotify_client.get_one("foo", json={})
@@ -908,7 +910,9 @@ def test_get_playlist_sets_params_for_playlist(self, spotify_client):
908910
@responses.activate
909911
def test_get_playlist_error(self, spotify_client, caplog):
910912
responses.add(
911-
responses.GET, self.url("playlists/foo"), json={"error": "bar"},
913+
responses.GET,
914+
self.url("playlists/foo"),
915+
json={"error": "bar"},
912916
)
913917

914918
result = spotify_client.get_playlist("spotify:playlist:foo")

0 commit comments

Comments
 (0)