]> Untitled Git - lemmy.git/blobdiff - crates/apub/src/protocol/activities/create_or_update/mod.rs
Cache & Optimize Woodpecker CI (#3450)
[lemmy.git] / crates / apub / src / protocol / activities / create_or_update / mod.rs
index 160bbfba305406996bdb44d312cb1c06c535c693..a516bf9b406c8a7ad83c34c85055694f34ee29e7 100644 (file)
@@ -1,42 +1,38 @@
-pub mod comment;
-pub mod post;
+pub mod chat_message;
+pub mod note;
+pub mod page;
 
 #[cfg(test)]
 mod tests {
-  use crate::{
-    context::WithContext,
-    objects::tests::file_to_json_object,
-    protocol::{
-      activities::create_or_update::{comment::CreateOrUpdateComment, post::CreateOrUpdatePost},
-      tests::test_parse_lemmy_item,
+  #![allow(clippy::unwrap_used)]
+  #![allow(clippy::indexing_slicing)]
+
+  use crate::protocol::{
+    activities::create_or_update::{
+      chat_message::CreateOrUpdateChatMessage,
+      note::CreateOrUpdateNote,
+      page::CreateOrUpdatePage,
     },
+    tests::test_parse_lemmy_item,
   };
 
-  #[actix_rt::test]
-  async fn test_parse_create_or_update() {
-    test_parse_lemmy_item::<CreateOrUpdatePost>(
+  #[test]
+  fn test_parse_lemmy_create_or_update() {
+    test_parse_lemmy_item::<CreateOrUpdatePage>(
       "assets/lemmy/activities/create_or_update/create_page.json",
-    );
-    test_parse_lemmy_item::<CreateOrUpdatePost>(
+    )
+    .unwrap();
+    test_parse_lemmy_item::<CreateOrUpdatePage>(
       "assets/lemmy/activities/create_or_update/update_page.json",
-    );
-    test_parse_lemmy_item::<CreateOrUpdateComment>(
+    )
+    .unwrap();
+    test_parse_lemmy_item::<CreateOrUpdateNote>(
       "assets/lemmy/activities/create_or_update/create_note.json",
-    );
-
-    file_to_json_object::<WithContext<CreateOrUpdateComment>>(
-      "assets/pleroma/activities/create_note.json",
     )
     .unwrap();
-    file_to_json_object::<WithContext<CreateOrUpdateComment>>(
-      "assets/smithereen/activities/create_note.json",
+    test_parse_lemmy_item::<CreateOrUpdateChatMessage>(
+      "assets/lemmy/activities/create_or_update/create_private_message.json",
     )
     .unwrap();
-    file_to_json_object::<CreateOrUpdateComment>("assets/mastodon/activities/create_note.json")
-      .unwrap();
-
-    file_to_json_object::<CreateOrUpdatePost>("assets/lotide/activities/create_page.json").unwrap();
-    file_to_json_object::<CreateOrUpdateComment>("assets/lotide/activities/create_note_reply.json")
-      .unwrap();
   }
 }