1 use serde::{Deserialize, Serialize};
4 pub(crate) mod chat_message;
6 pub(crate) mod instance;
10 pub(crate) mod tombstone;
12 #[derive(Clone, Debug, Deserialize, Serialize)]
13 #[serde(rename_all = "camelCase")]
14 pub struct Endpoints {
15 pub shared_inbox: Url,
22 objects::tests::file_to_json_object,
25 chat_message::ChatMessage,
33 tests::test_parse_lemmy_item,
38 async fn test_parse_objects_lemmy() {
39 test_parse_lemmy_item::<Instance>("assets/lemmy/objects/instance.json").unwrap();
40 test_parse_lemmy_item::<Group>("assets/lemmy/objects/group.json").unwrap();
41 test_parse_lemmy_item::<Person>("assets/lemmy/objects/person.json").unwrap();
42 test_parse_lemmy_item::<Page>("assets/lemmy/objects/page.json").unwrap();
43 test_parse_lemmy_item::<Note>("assets/lemmy/objects/note.json").unwrap();
44 test_parse_lemmy_item::<ChatMessage>("assets/lemmy/objects/chat_message.json").unwrap();
45 test_parse_lemmy_item::<Tombstone>("assets/lemmy/objects/tombstone.json").unwrap();
49 async fn test_parse_objects_pleroma() {
50 file_to_json_object::<WithContext<Person>>("assets/pleroma/objects/person.json").unwrap();
51 file_to_json_object::<WithContext<Note>>("assets/pleroma/objects/note.json").unwrap();
52 file_to_json_object::<WithContext<ChatMessage>>("assets/pleroma/objects/chat_message.json")
57 async fn test_parse_objects_smithereen() {
58 file_to_json_object::<WithContext<Person>>("assets/smithereen/objects/person.json").unwrap();
59 file_to_json_object::<Note>("assets/smithereen/objects/note.json").unwrap();
63 async fn test_parse_objects_mastodon() {
64 file_to_json_object::<WithContext<Person>>("assets/mastodon/objects/person.json").unwrap();
65 file_to_json_object::<WithContext<Note>>("assets/mastodon/objects/note.json").unwrap();
69 async fn test_parse_objects_lotide() {
70 file_to_json_object::<WithContext<Group>>("assets/lotide/objects/group.json").unwrap();
71 file_to_json_object::<WithContext<Person>>("assets/lotide/objects/person.json").unwrap();
72 file_to_json_object::<WithContext<Note>>("assets/lotide/objects/note.json").unwrap();
73 file_to_json_object::<WithContext<Page>>("assets/lotide/objects/page.json").unwrap();
74 file_to_json_object::<WithContext<Tombstone>>("assets/lotide/objects/tombstone.json").unwrap();
78 async fn test_parse_object_friendica() {
79 file_to_json_object::<WithContext<Person>>("assets/friendica/objects/person.json").unwrap();
80 file_to_json_object::<WithContext<Note>>("assets/friendica/objects/note.json").unwrap();