Skip to content
Snippets Groups Projects
Verified Commit f2c319c6 authored by Georg Krause's avatar Georg Krause
Browse files

Fix formatting of test files

parent 83cabe6f
No related branches found
No related tags found
1 merge request!1Add basic model tests
Pipeline #23708 failed
Showing
with 56 additions and 55 deletions
import pytest
......@@ -2,7 +2,7 @@ import pytest
from funkwhale_api_client import Client
@pytest.fixture
def client() -> Client:
return Client(base_url="https://soundship.de")
from funkwhale_api_client.models import PaginatedAlbumList
from funkwhale_api_client.api.activity import activity_list
def test_activity_list(client):
response = activity_list.sync_detailed(client=client)
print(response)
......
from funkwhale_api_client.api.albums import albums_list, albums_retrieve
from funkwhale_api_client.models import PaginatedAlbumList
from funkwhale_api_client.api.albums import albums_list, albums_retrieve
def test_album_list(client):
albums: PaginatedAlbumList = albums_list.sync(client=client)
......@@ -8,6 +8,7 @@ def test_album_list(client):
for album in albums.results:
print(album.title)
def test_album_retrieve(client):
album = albums_retrieve.sync(client=client, id=12)
print(album)
from funkwhale_api_client.models import PaginatedArtistWithAlbumsList
from funkwhale_api_client.api.artists import artists_list
from funkwhale_api_client.models import PaginatedArtistWithAlbumsList
def test_artist_list(client):
artists: PaginatedArtistWithAlbumsList | None = artists_list.sync(client=client)
......
import pytest
import json
import pytest
@pytest.fixture
def load_data():
def _load_data(requested_file: str):
with open(f'tests/data/{requested_file}.json') as data:
with open(f"tests/data/{requested_file}.json") as data:
return json.load(data)
return _load_data
import json
from funkwhale_api_client.models.activity_object import ActivityObject
def test_ActivityObject(load_data):
response = load_data("activity")
activity: ActivityObject = ActivityObject.from_dict(response)
......
import json
from funkwhale_api_client.models.activity_related_object import ActivityRelatedObject
def test_ActivityRelatedObject(load_data):
response = load_data("activity")
activity_related_object: ActivityRelatedObject = ActivityRelatedObject.from_dict(response)
......
import json
from funkwhale_api_client.models.album import Album
def test_Album(load_data):
response = load_data("album")
album: Album = Album.from_dict(response)
......
import json
from funkwhale_api_client.models.api_mutation import APIMutation
def test_APIMutation(load_data):
response = load_data("api_mutation")
mutation: APIMutation = APIMutation.from_dict(response)
......
import json
from funkwhale_api_client.models.artist_with_albums import ArtistWithAlbums
def test_ArtistWithAlbums(load_data):
response = load_data("artist")
artist: ArtistWithAlbums = ArtistWithAlbums.from_dict(response)
......
import json
from funkwhale_api_client.models.attachment import Attachment
def test_Attachment(load_data):
response = load_data("attachment")
attachment: Attachment = Attachment.from_dict(response)
......
import json
from funkwhale_api_client.models.channel import Channel
def test_Channel(load_data):
response = load_data("channel")
channel: Channel = Channel.from_dict(response)
......
import json
from funkwhale_api_client.models.global_preference import GlobalPreference
def test_GlobalPreference(load_data):
response = load_data("settings")
settings: GlobalPreference = GlobalPreference.from_dict(response)
......
import json
from funkwhale_api_client.models.global_preference_request import GlobalPreferenceRequest
def test_GlobalPreferenceRequest(load_data):
response = load_data("global_preference_request")
preference_request: GlobalPreferenceRequest = GlobalPreferenceRequest.from_dict(response)
......
import json
from funkwhale_api_client.models.inbox_item import InboxItem
def test_InboxItem(load_data):
response = load_data("federation_inbox_item")
inbox_item: InboxItem = InboxItem.from_dict(response)
......
import json
from funkwhale_api_client.models.library import Library
def test_Library(load_data):
response = load_data("library")
library: Library = Library.from_dict(response)
......
import json
from funkwhale_api_client.models.library_follow import LibraryFollow
def test_LibraryFollow(load_data):
response = load_data("library_follow")
library_follow: LibraryFollow = LibraryFollow.from_dict(response)
......
import json
from funkwhale_api_client.models.library_follow import LibraryFollow
def test_LibraryFollowAll(load_data):
response = load_data("library_follow")
library_follow_all: LibraryFollow = LibraryFollow.from_dict(response)
......
import json
from funkwhale_api_client.models.library_follow_request import LibraryFollowRequest
def test_LibraryFollowRequest(load_data):
response = load_data("library_follow_request")
follow_request: LibraryFollowRequest = LibraryFollowRequest.from_dict(response)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment