X-Git-Url: http://these/git/?a=blobdiff_plain;f=crates%2Fapub%2Fsrc%2Fprotocol%2Factivities%2Fmod.rs;h=24095faba7148f0049d0d568526b63704235dd1c;hb=92568956353f21649ed9aff68b42699c9d036f30;hp=3b8c9e20ceec8a9d60b9bc153eaee941a6f7fe14;hpb=08a797c986ba92736f12761b18980f557dd156d4;p=lemmy.git diff --git a/crates/apub/src/protocol/activities/mod.rs b/crates/apub/src/protocol/activities/mod.rs index 3b8c9e20..24095fab 100644 --- a/crates/apub/src/protocol/activities/mod.rs +++ b/crates/apub/src/protocol/activities/mod.rs @@ -8,7 +8,7 @@ pub mod deletion; pub mod following; pub mod voting; -#[derive(Clone, Debug, Display, Deserialize, Serialize, PartialEq)] +#[derive(Clone, Debug, Display, Deserialize, Serialize, PartialEq, Eq)] pub enum CreateOrUpdateType { Create, Update, @@ -16,12 +16,15 @@ pub enum CreateOrUpdateType { #[cfg(test)] mod tests { + #![allow(clippy::unwrap_used)] + #![allow(clippy::indexing_slicing)] + use crate::protocol::{ activities::{ community::announce::AnnounceActivity, - create_or_update::{comment::CreateOrUpdateComment, post::CreateOrUpdatePost}, + create_or_update::{note::CreateOrUpdateNote, page::CreateOrUpdatePage}, deletion::delete::Delete, - following::{follow::FollowCommunity, undo_follow::UndoFollowCommunity}, + following::{follow::Follow, undo_follow::UndoFollow}, voting::{undo_vote::UndoVote, vote::Vote}, }, tests::test_json, @@ -29,39 +32,40 @@ mod tests { #[test] fn test_parse_smithereen_activities() { - test_json::("assets/smithereen/activities/create_note.json").unwrap(); + test_json::("assets/smithereen/activities/create_note.json").unwrap(); } #[test] fn test_parse_pleroma_activities() { - test_json::("assets/pleroma/activities/create_note.json").unwrap(); + test_json::("assets/pleroma/activities/create_note.json").unwrap(); test_json::("assets/pleroma/activities/delete.json").unwrap(); - test_json::("assets/pleroma/activities/follow.json").unwrap(); + test_json::("assets/pleroma/activities/follow.json").unwrap(); } #[test] fn test_parse_mastodon_activities() { - test_json::("assets/mastodon/activities/create_note.json").unwrap(); + test_json::("assets/mastodon/activities/create_note.json").unwrap(); test_json::("assets/mastodon/activities/delete.json").unwrap(); - test_json::("assets/mastodon/activities/follow.json").unwrap(); - test_json::("assets/mastodon/activities/undo_follow.json").unwrap(); + test_json::("assets/mastodon/activities/follow.json").unwrap(); + test_json::("assets/mastodon/activities/undo_follow.json").unwrap(); test_json::("assets/mastodon/activities/like_page.json").unwrap(); test_json::("assets/mastodon/activities/undo_like_page.json").unwrap(); } #[test] fn test_parse_lotide_activities() { - test_json::("assets/lotide/activities/create_page.json").unwrap(); - test_json::("assets/lotide/activities/create_page_image.json").unwrap(); - test_json::("assets/lotide/activities/create_note_reply.json").unwrap(); + test_json::("assets/lotide/activities/follow.json").unwrap(); + test_json::("assets/lotide/activities/create_page.json").unwrap(); + test_json::("assets/lotide/activities/create_page_image.json").unwrap(); + test_json::("assets/lotide/activities/create_note_reply.json").unwrap(); } #[test] fn test_parse_friendica_activities() { - test_json::("assets/friendica/activities/create_page_1.json").unwrap(); - test_json::("assets/friendica/activities/create_page_2.json").unwrap(); - test_json::("assets/friendica/activities/create_note.json").unwrap(); - test_json::("assets/friendica/activities/update_note.json").unwrap(); + test_json::("assets/friendica/activities/create_page_1.json").unwrap(); + test_json::("assets/friendica/activities/create_page_2.json").unwrap(); + test_json::("assets/friendica/activities/create_note.json").unwrap(); + test_json::("assets/friendica/activities/update_note.json").unwrap(); test_json::("assets/friendica/activities/delete.json").unwrap(); test_json::("assets/friendica/activities/like_page.json").unwrap(); test_json::("assets/friendica/activities/dislike_page.json").unwrap(); @@ -70,8 +74,8 @@ mod tests { #[test] fn test_parse_gnusocial_activities() { - test_json::("assets/gnusocial/activities/create_page.json").unwrap(); - test_json::("assets/gnusocial/activities/create_note.json").unwrap(); + test_json::("assets/gnusocial/activities/create_page.json").unwrap(); + test_json::("assets/gnusocial/activities/create_note.json").unwrap(); test_json::("assets/gnusocial/activities/like_note.json").unwrap(); }