]> Untitled Git - lemmy.git/blobdiff - crates/apub/src/protocol/objects/mod.rs
Implement instance actor (#1798)
[lemmy.git] / crates / apub / src / protocol / objects / mod.rs
index 139fe0fcee8368d29fbbab89df23a4bb55b273de..20aaca181cfef1f92560efb99ee4d041bd212445 100644 (file)
@@ -3,6 +3,7 @@ use url::Url;
 
 pub(crate) mod chat_message;
 pub(crate) mod group;
+pub(crate) mod instance;
 pub(crate) mod note;
 pub(crate) mod page;
 pub(crate) mod person;
@@ -23,6 +24,7 @@ mod tests {
       objects::{
         chat_message::ChatMessage,
         group::Group,
+        instance::Instance,
         note::Note,
         page::Page,
         person::Person,
@@ -33,9 +35,10 @@ mod tests {
   };
 
   #[actix_rt::test]
-  async fn test_parse_object_lemmy() {
-    test_parse_lemmy_item::<Person>("assets/lemmy/objects/person.json").unwrap();
+  async fn test_parse_objects_lemmy() {
+    test_parse_lemmy_item::<Instance>("assets/lemmy/objects/instance.json").unwrap();
     test_parse_lemmy_item::<Group>("assets/lemmy/objects/group.json").unwrap();
+    test_parse_lemmy_item::<Person>("assets/lemmy/objects/person.json").unwrap();
     test_parse_lemmy_item::<Page>("assets/lemmy/objects/page.json").unwrap();
     test_parse_lemmy_item::<Note>("assets/lemmy/objects/note.json").unwrap();
     test_parse_lemmy_item::<ChatMessage>("assets/lemmy/objects/chat_message.json").unwrap();
@@ -43,7 +46,7 @@ mod tests {
   }
 
   #[actix_rt::test]
-  async fn test_parse_object_pleroma() {
+  async fn test_parse_objects_pleroma() {
     file_to_json_object::<WithContext<Person>>("assets/pleroma/objects/person.json").unwrap();
     file_to_json_object::<WithContext<Note>>("assets/pleroma/objects/note.json").unwrap();
     file_to_json_object::<WithContext<ChatMessage>>("assets/pleroma/objects/chat_message.json")
@@ -51,23 +54,29 @@ mod tests {
   }
 
   #[actix_rt::test]
-  async fn test_parse_object_smithereen() {
+  async fn test_parse_objects_smithereen() {
     file_to_json_object::<WithContext<Person>>("assets/smithereen/objects/person.json").unwrap();
     file_to_json_object::<Note>("assets/smithereen/objects/note.json").unwrap();
   }
 
   #[actix_rt::test]
-  async fn test_parse_object_mastodon() {
+  async fn test_parse_objects_mastodon() {
     file_to_json_object::<WithContext<Person>>("assets/mastodon/objects/person.json").unwrap();
     file_to_json_object::<WithContext<Note>>("assets/mastodon/objects/note.json").unwrap();
   }
 
   #[actix_rt::test]
-  async fn test_parse_object_lotide() {
+  async fn test_parse_objects_lotide() {
     file_to_json_object::<WithContext<Group>>("assets/lotide/objects/group.json").unwrap();
     file_to_json_object::<WithContext<Person>>("assets/lotide/objects/person.json").unwrap();
     file_to_json_object::<WithContext<Note>>("assets/lotide/objects/note.json").unwrap();
     file_to_json_object::<WithContext<Page>>("assets/lotide/objects/page.json").unwrap();
     file_to_json_object::<WithContext<Tombstone>>("assets/lotide/objects/tombstone.json").unwrap();
   }
+
+  #[actix_rt::test]
+  async fn test_parse_object_friendica() {
+    file_to_json_object::<WithContext<Person>>("assets/friendica/objects/person.json").unwrap();
+    file_to_json_object::<WithContext<Note>>("assets/friendica/objects/note.json").unwrap();
+  }
 }