style: format code using black v23

This commit is contained in:
jo 2023-03-28 19:34:19 +02:00
commit 22c255700e
No known key found for this signature in database
GPG key ID: B2FEC9B22722B984
46 changed files with 8 additions and 67 deletions

View file

@ -138,7 +138,6 @@ def test_channel_update_permission(logged_in_api_client, factories):
def test_channel_delete(logged_in_api_client, factories, mocker):
actor = logged_in_api_client.user.create_actor()
channel = factories["audio.Channel"](attributed_to=actor)
@ -336,7 +335,6 @@ def test_channel_rss_feed_authentication_required(factories, api_client, prefere
def test_channel_metadata_choices(factories, api_client):
expected = {
"language": [
{"value": code, "label": name} for code, name in locales.ISO_639_CHOICES

View file

@ -16,7 +16,6 @@ from funkwhale_api.federation import (
def test_receive_validates_basic_attributes_and_stores_activity(
mrf_inbox_registry, factories, now, mocker
):
mocker.patch.object(
activity.InboxRouter, "get_matching_handlers", return_value=True
)
@ -598,7 +597,6 @@ def test_prepare_deliveries_and_inbox_items_allow_list(factories, preferences):
def test_prepare_deliveries_and_inbox_items_instances_with_followers(factories):
domain1 = factories["federation.Domain"](with_service_actor=True)
domain2 = factories["federation.Domain"](with_service_actor=True)
library = factories["music.Library"](actor__local=True)

View file

@ -237,7 +237,6 @@ async def test_fetch_many(a_responses):
def test_dereference():
followers_doc = {
"@context": jsonld.get_default_context(),
"id": "https://noop/federation/actors/demo/followers",

View file

@ -401,7 +401,6 @@ def test_inbox_delete_library(factories):
def test_inbox_delete_album(factories):
album = factories["music.Album"](attributed=True)
payload = {
"type": "Delete",

View file

@ -4,7 +4,6 @@ from funkwhale_api.federation import routes, serializers
def test_pleroma_actor_from_ap_with_tags(factories):
payload = {
"@context": [
"https://www.w3.org/ns/activitystreams",
@ -73,7 +72,6 @@ def test_pleroma_actor_from_ap_with_tags(factories):
def test_pleroma_actor_from_ap(factories):
payload = {
"@context": [
"https://www.w3.org/ns/activitystreams",

View file

@ -156,7 +156,6 @@ def test_import_track_with_different_artist_than_release(factories, mocker):
"extension,mimetype", [("ogg", "audio/ogg"), ("mp3", "audio/mpeg")]
)
def test_audio_track_mime_type(extension, mimetype, factories):
name = ".".join(["test", extension])
path = os.path.join(DATA_DIR, name)
upload = factories["music.Upload"](audio_file__from_path=path, mimetype=None)
@ -166,7 +165,6 @@ def test_audio_track_mime_type(extension, mimetype, factories):
@pytest.mark.parametrize("name", ["test.ogg", "test.mp3"])
def test_audio_track_checksum(name, factories):
path = os.path.join(DATA_DIR, name)
upload = factories["music.Upload"](audio_file__from_path=path, mimetype=None)

View file

@ -135,7 +135,6 @@ def test_clean_config_is_called_on_serializer_save(mocker, factories):
@pytest.mark.parametrize("radio_type", ["random", "less-listened", "favorites"])
def test_create_radio_session(radio_type, logged_in_api_client):
url = reverse("api:v1:radios:sessions-list")
response = logged_in_api_client.post(url, {"radio_type": radio_type})

View file

@ -2,7 +2,6 @@ from funkwhale_api.radios import filters
def test_clean_config_artist_name_sorting(factories):
artist3 = factories["music.Artist"](name="The Green Eyes")
artist2 = factories["music.Artist"](name="The Green Eyed Machine")
artist1 = factories["music.Artist"](name="The Green Seed")
@ -21,7 +20,6 @@ def test_clean_config_artist_name_sorting(factories):
def test_clean_config_tag_name_sorting(factories):
tag3 = factories["tags.Tag"](name="Rock")
tag2 = factories["tags.Tag"](name="Classic")
tag1 = factories["tags.Tag"](name="Punk")

View file

@ -419,7 +419,7 @@ def test_can_start_custom_multiple_radio_from_api(api_client, factories):
tracks = factories["music.Track"].create_batch(5)
url = reverse("api:v1:radios:sessions-list")
map_filters_to_type = {"tags": "names", "artists": "ids", "playlists": "names"}
for (key, value) in map_filters_to_type.items():
for key, value in map_filters_to_type.items():
attr = value[:-1]
track_filter_key = [getattr(a.artist, attr) for a in tracks]
config = {"filters": [{"type": key, value: track_filter_key}]}

View file

@ -2,5 +2,4 @@ from . import utils as test_utils
def test_to_api_date(now):
assert test_utils.to_api_date(now) == now.isoformat().split("+")[0] + "Z"

View file

@ -187,5 +187,4 @@ from funkwhale_api.users.oauth import scopes
],
)
def test_get_scopes_from_user_permissions(user_perms, expected):
assert scopes.get_from_permissions(**user_perms) == expected