test: share the photo payload fixture, drop two test-only aliases

The one-photo MediaItemPayload literal was written out at six sites across
the urls and send test modules; ctx::test_support::photo_item holds it once.
permanent_error now delegates to api_error (it stays a fn pointer because
that is what MockSender::scripted takes), misskey's x_media_site_id wrapper
is gone in favour of the function it renamed, and PixivAPI is no longer
re-exported -- nothing outside pixiv/api.rs names it.
This commit is contained in:
2026-09-21 17:22:02 +08:00
parent 7a61077d80
commit f21570f579
5 changed files with 28 additions and 48 deletions
+1 -5
View File
@@ -220,11 +220,7 @@ mod tests {
cache_key("https://misskey.io/notes/aotihl10lqrs015s"),
Some("misskey:aotihl10lqrs015s".to_string())
);
assert_eq!(x_media_site_id("misskey:abc"), "misskey");
}
fn x_media_site_id(key: &str) -> &'static str {
crate::site::site_id_from_key(key)
assert_eq!(crate::site::site_id_from_key("misskey:abc"), "misskey");
}
#[test]
+1 -1
View File
@@ -2,7 +2,7 @@ mod api;
mod interface;
mod model;
pub use api::{PixivAPI, PixivError, disable, fetch, validate};
pub use api::{PixivError, disable, fetch, validate};
pub use interface::{
Illustration, PATTERN, PixivSite, cache_key, enabled, fetch_from_url, is_retryable,
media_headers,