feat(api): Add NodeInfo 2.1
Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2604>
This commit is contained in:
parent
71140d5a9b
commit
a0ae9bbb70
9 changed files with 263 additions and 29 deletions
|
|
@ -6,7 +6,7 @@ from funkwhale_api import __version__ as api_version
|
|||
from funkwhale_api.music.utils import SUPPORTED_EXTENSIONS
|
||||
|
||||
|
||||
def test_nodeinfo_default(api_client):
|
||||
def test_nodeinfo_20(api_client):
|
||||
url = reverse("api:v1:instance:nodeinfo-2.0")
|
||||
response = api_client.get(url)
|
||||
|
||||
|
|
@ -89,3 +89,73 @@ def test_nodeinfo_default(api_client):
|
|||
}
|
||||
|
||||
assert response.data == expected
|
||||
|
||||
|
||||
def test_nodeinfo_21(api_client):
|
||||
url = reverse("api:v2:instance:nodeinfo-2.1")
|
||||
response = api_client.get(url)
|
||||
|
||||
expected = {
|
||||
"version": "2.1",
|
||||
"software": OrderedDict(
|
||||
[
|
||||
("name", "funkwhale"),
|
||||
("version", api_version),
|
||||
("repository", "https://dev.funkwhale.audio/funkwhale/funkwhale"),
|
||||
("homepage", "https://funkwhale.audio"),
|
||||
]
|
||||
),
|
||||
"protocols": ["activitypub"],
|
||||
"services": OrderedDict([("inbound", ["atom1.0"]), ("outbound", ["atom1.0"])]),
|
||||
"openRegistrations": False,
|
||||
"usage": {
|
||||
"users": OrderedDict(
|
||||
[("total", 0), ("activeHalfyear", 0), ("activeMonth", 0)]
|
||||
),
|
||||
"localPosts": 0,
|
||||
"localComments": 0,
|
||||
},
|
||||
"metadata": {
|
||||
"actorId": "https://test.federation/federation/actors/service",
|
||||
"private": False,
|
||||
"shortDescription": "",
|
||||
"longDescription": "",
|
||||
"contactEmail": "",
|
||||
"nodeName": "",
|
||||
"banner": None,
|
||||
"defaultUploadQuota": 1000,
|
||||
"supportedUploadExtensions": SUPPORTED_EXTENSIONS,
|
||||
"allowList": {"enabled": False, "domains": None},
|
||||
"funkwhaleSupportMessageEnabled": True,
|
||||
"instanceSupportMessage": "",
|
||||
"usage": OrderedDict(
|
||||
[
|
||||
("favorites", OrderedDict([("tracks", {"total": 0})])),
|
||||
("listenings", OrderedDict([("total", 0)])),
|
||||
("downloads", OrderedDict([("total", 0)])),
|
||||
]
|
||||
),
|
||||
"location": "",
|
||||
"languages": ["en"],
|
||||
"features": ["channels", "podcasts", "federation"],
|
||||
"content": OrderedDict(
|
||||
[
|
||||
(
|
||||
"local",
|
||||
OrderedDict(
|
||||
[
|
||||
("artists", 0),
|
||||
("releases", 0),
|
||||
("recordings", 0),
|
||||
("hoursOfContent", 0),
|
||||
]
|
||||
),
|
||||
),
|
||||
("topMusicCategories", []),
|
||||
("topPodcastCategories", []),
|
||||
]
|
||||
),
|
||||
},
|
||||
}
|
||||
|
||||
assert response.data == expected
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue