diff --git a/tests/data/library_follow_request.json b/tests/data/library_follow_request.json new file mode 100644 index 0000000000000000000000000000000000000000..3d44fa1bc587948175e8be60cdaa484139ce84c0 --- /dev/null +++ b/tests/data/library_follow_request.json @@ -0,0 +1,3 @@ +{ + "target": "a713f619-6a62-4aff-ad73-66c791920108" +} \ No newline at end of file diff --git a/tests/data/paginated_api_mutation_list.json b/tests/data/paginated_api_mutation_list.json new file mode 100644 index 0000000000000000000000000000000000000000..b409a8dd2d55187cea9414d6f9abe4c37a28c2cf --- /dev/null +++ b/tests/data/paginated_api_mutation_list.json @@ -0,0 +1,83 @@ +{ + "count": 1132, + "next": "https://tanukitunes.com/api/v1/mutations?ordering=creation_date&page=2&page_size=2", + "previous": null, + "results": [ + { + "fid": "https://tanukitunes.com/federation/edits/e272f41a-c2af-434e-a6c1-4c348ec6f96d", + "uuid": "e272f41a-c2af-434e-a6c1-4c348ec6f96d", + "type": "update", + "creation_date": "2019-05-05T22:05:26.883622Z", + "applied_date": "2019-05-05T22:05:26.944001Z", + "is_approved": true, + "is_applied": true, + "created_by": { + "fid": "https://tanukitunes.com/federation/actors/doctorworm", + "url": null, + "creation_date": "2018-12-12T22:12:18Z", + "summary": null, + "preferred_username": "doctorworm", + "name": "doctorworm", + "last_fetch_date": "2021-06-13T14:13:41Z", + "domain": "tanukitunes.com", + "type": "Person", + "manually_approves_followers": false, + "full_username": "doctorworm@tanukitunes.com", + "is_local": true + }, + "approved_by": null, + "summary": "Added CCBYA3", + "payload": { + "license": "cc-by-3.0" + }, + "previous_state": { + "license": { + "value": null + } + }, + "target": { + "type": "track", + "id": 1, + "repr": "Kowloon City" + } + }, + { + "fid": "https://tanukitunes.com/federation/edits/c7ff3f86-5573-4f0b-89e6-8df9be9e6edd", + "uuid": "c7ff3f86-5573-4f0b-89e6-8df9be9e6edd", + "type": "update", + "creation_date": "2019-05-05T22:05:54.152095Z", + "applied_date": "2019-05-05T22:05:54.192031Z", + "is_approved": true, + "is_applied": true, + "created_by": { + "fid": "https://tanukitunes.com/federation/actors/doctorworm", + "url": null, + "creation_date": "2018-12-12T22:12:18Z", + "summary": null, + "preferred_username": "doctorworm", + "name": "doctorworm", + "last_fetch_date": "2021-06-13T14:13:41Z", + "domain": "tanukitunes.com", + "type": "Person", + "manually_approves_followers": false, + "full_username": "doctorworm@tanukitunes.com", + "is_local": true + }, + "approved_by": null, + "summary": "Added CCBYA3", + "payload": { + "license": "cc-by-3.0" + }, + "previous_state": { + "license": { + "value": null + } + }, + "target": { + "type": "track", + "id": 2, + "repr": "The Rain Over Hong Kong" + } + } + ] +} \ No newline at end of file diff --git a/tests/data/paginated_application_list.json b/tests/data/paginated_application_list.json new file mode 100644 index 0000000000000000000000000000000000000000..571689130315fba1e6d9d8a960cff7dc5559f760 --- /dev/null +++ b/tests/data/paginated_application_list.json @@ -0,0 +1,23 @@ +{ + "count": 2, + "next": null, + "previous": null, + "results": [ + { + "client_id": "0bxRvjIMbZUYBJH39cJ1j7MBjo0R71axG8cZdYxm", + "name": "Swagger", + "scopes": "read", + "created": "2022-07-18T20:12:20.390955Z", + "updated": "2022-07-18T20:23:08.641340Z", + "token": "very-authentic-definitely-real-token" + }, + { + "client_id": "bVRCxF7F570FGgHRWWGL1JTQiH2KyRereE6tmihp", + "name": "Funkwhale CLI", + "scopes": "read", + "created": "2022-06-17T14:32:36.572114Z", + "updated": "2022-06-17T14:32:36.572136Z", + "token": "another-authentic-definitely-real-token" + } + ] +} \ No newline at end of file diff --git a/tests/unit/test_model_library_follow_request.py b/tests/unit/test_model_library_follow_request.py new file mode 100644 index 0000000000000000000000000000000000000000..662a9606f042ac294362fddca80cd147260cc549 --- /dev/null +++ b/tests/unit/test_model_library_follow_request.py @@ -0,0 +1,8 @@ +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) + + assert isinstance(follow_request, LibraryFollowRequest) \ No newline at end of file diff --git a/tests/unit/test_model_paginated_api_mutation_list.py b/tests/unit/test_model_paginated_api_mutation_list.py new file mode 100644 index 0000000000000000000000000000000000000000..69824191aa76bdccbf5137f68ab2f41769930fcf --- /dev/null +++ b/tests/unit/test_model_paginated_api_mutation_list.py @@ -0,0 +1,8 @@ +import json +from funkwhale_api_client.models.paginated_api_mutation_list import PaginatedAPIMutationList + +def test_PaginatedAPIMutationList(load_data): + response = load_data("paginated_api_mutation_list") + mutation_list : PaginatedAPIMutationList = PaginatedAPIMutationList.from_dict(response) + + assert isinstance(mutation_list, PaginatedAPIMutationList) \ No newline at end of file diff --git a/tests/unit/test_model_paginated_application_list.py b/tests/unit/test_model_paginated_application_list.py new file mode 100644 index 0000000000000000000000000000000000000000..c6049faafb26baebce6393a23f4ba715fc9cbd60 --- /dev/null +++ b/tests/unit/test_model_paginated_application_list.py @@ -0,0 +1,8 @@ +import json +from funkwhale_api_client.models.paginated_application_list import PaginatedApplicationList + +def test_PaginatedApplicationList(load_data): + response = load_data("paginated_application_list") + application_list : PaginatedApplicationList = PaginatedApplicationList.from_dict(response) + + assert isinstance(application_list, PaginatedApplicationList) \ No newline at end of file