2022-02-07 19:23:12 +00:00
|
|
|
pub(crate) mod empty_outbox;
|
2021-10-28 21:17:59 +00:00
|
|
|
pub(crate) mod group_followers;
|
|
|
|
pub(crate) mod group_moderators;
|
|
|
|
pub(crate) mod group_outbox;
|
2021-11-01 13:05:20 +00:00
|
|
|
|
|
|
|
#[cfg(test)]
|
|
|
|
mod tests {
|
|
|
|
use crate::protocol::{
|
|
|
|
collections::{
|
2022-02-07 19:23:12 +00:00
|
|
|
empty_outbox::EmptyOutbox,
|
2021-11-01 13:05:20 +00:00
|
|
|
group_followers::GroupFollowers,
|
|
|
|
group_moderators::GroupModerators,
|
|
|
|
group_outbox::GroupOutbox,
|
|
|
|
},
|
|
|
|
tests::test_parse_lemmy_item,
|
|
|
|
};
|
|
|
|
|
2022-02-17 22:04:01 +00:00
|
|
|
#[test]
|
|
|
|
fn test_parse_lemmy_collections() {
|
2022-01-20 14:13:29 +00:00
|
|
|
test_parse_lemmy_item::<GroupFollowers>("assets/lemmy/collections/group_followers.json")
|
|
|
|
.unwrap();
|
|
|
|
let outbox =
|
|
|
|
test_parse_lemmy_item::<GroupOutbox>("assets/lemmy/collections/group_outbox.json").unwrap();
|
2021-11-01 13:05:20 +00:00
|
|
|
assert_eq!(outbox.ordered_items.len() as i32, outbox.total_items);
|
2022-01-20 14:13:29 +00:00
|
|
|
test_parse_lemmy_item::<GroupModerators>("assets/lemmy/collections/group_moderators.json")
|
|
|
|
.unwrap();
|
2022-02-07 19:23:12 +00:00
|
|
|
test_parse_lemmy_item::<EmptyOutbox>("assets/lemmy/collections/person_outbox.json").unwrap();
|
2021-11-01 13:05:20 +00:00
|
|
|
}
|
|
|
|
}
|