1 use serde::{Deserialize, Serialize};
4 pub(crate) mod chat_message;
9 pub(crate) mod tombstone;
11 #[derive(Clone, Debug, Deserialize, Serialize)]
12 #[serde(rename_all = "camelCase")]
13 pub struct Endpoints {
14 pub shared_inbox: Url,
21 objects::tests::file_to_json_object,
24 chat_message::ChatMessage,
31 tests::test_parse_lemmy_item,
36 async fn test_parse_object_lemmy() {
37 test_parse_lemmy_item::<Person>("assets/lemmy/objects/person.json").unwrap();
38 test_parse_lemmy_item::<Group>("assets/lemmy/objects/group.json").unwrap();
39 test_parse_lemmy_item::<Page>("assets/lemmy/objects/page.json").unwrap();
40 test_parse_lemmy_item::<Note>("assets/lemmy/objects/note.json").unwrap();
41 test_parse_lemmy_item::<ChatMessage>("assets/lemmy/objects/chat_message.json").unwrap();
42 test_parse_lemmy_item::<Tombstone>("assets/lemmy/objects/tombstone.json").unwrap();
46 async fn test_parse_object_pleroma() {
47 file_to_json_object::<WithContext<Person>>("assets/pleroma/objects/person.json").unwrap();
48 file_to_json_object::<WithContext<Note>>("assets/pleroma/objects/note.json").unwrap();
49 file_to_json_object::<WithContext<ChatMessage>>("assets/pleroma/objects/chat_message.json")
54 async fn test_parse_object_smithereen() {
55 file_to_json_object::<WithContext<Person>>("assets/smithereen/objects/person.json").unwrap();
56 file_to_json_object::<Note>("assets/smithereen/objects/note.json").unwrap();
60 async fn test_parse_object_mastodon() {
61 file_to_json_object::<WithContext<Person>>("assets/mastodon/objects/person.json").unwrap();
62 file_to_json_object::<WithContext<Note>>("assets/mastodon/objects/note.json").unwrap();
66 async fn test_parse_object_lotide() {
67 file_to_json_object::<WithContext<Group>>("assets/lotide/objects/group.json").unwrap();
68 file_to_json_object::<WithContext<Person>>("assets/lotide/objects/person.json").unwrap();
69 file_to_json_object::<WithContext<Note>>("assets/lotide/objects/note.json").unwrap();
70 file_to_json_object::<WithContext<Page>>("assets/lotide/objects/page.json").unwrap();
71 file_to_json_object::<WithContext<Tombstone>>("assets/lotide/objects/tombstone.json").unwrap();
75 async fn test_parse_object_friendica() {
76 file_to_json_object::<WithContext<Person>>("assets/friendica/objects/person.json").unwrap();
77 file_to_json_object::<WithContext<Note>>("assets/friendica/objects/note.json").unwrap();