pinakes-plugin-api: update manifest, types, and wasm interface
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Ic574cc8d1d24967a8c997a3092037e526a6a6964
This commit is contained in:
parent
eb6c0a3577
commit
c8425a4c34
4 changed files with 53 additions and 17 deletions
|
|
@ -106,10 +106,7 @@ async fn test_plugin_context_creation() {
|
|||
|
||||
assert_eq!(context.data_dir, PathBuf::from("/data/test-plugin"));
|
||||
assert_eq!(context.cache_dir, PathBuf::from("/cache/test-plugin"));
|
||||
assert_eq!(
|
||||
context.config.get("enabled").unwrap(),
|
||||
&serde_json::json!(true)
|
||||
);
|
||||
assert_eq!(&context.config["enabled"], &serde_json::json!(true));
|
||||
assert!(context.capabilities.network.enabled);
|
||||
assert_eq!(
|
||||
context.capabilities.max_memory_bytes,
|
||||
|
|
@ -178,7 +175,7 @@ async fn test_extracted_metadata_structure() {
|
|||
assert_eq!(metadata.width, Some(1920));
|
||||
assert_eq!(metadata.height, Some(1080));
|
||||
assert_eq!(metadata.tags.len(), 2);
|
||||
assert_eq!(metadata.custom_fields.get("color_space").unwrap(), "sRGB");
|
||||
assert_eq!(&metadata.custom_fields["color_space"], "sRGB");
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
|
@ -199,7 +196,7 @@ async fn test_search_query_serialization() {
|
|||
assert_eq!(deserialized.query_text, "nature landscape");
|
||||
assert_eq!(deserialized.limit, 50);
|
||||
assert_eq!(deserialized.offset, 0);
|
||||
assert_eq!(deserialized.filters.get("type").unwrap(), "image");
|
||||
assert_eq!(&deserialized.filters["type"], "image");
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
|
@ -439,7 +436,7 @@ async fn test_plugin_error_variants() {
|
|||
for error in errors {
|
||||
let serialized = serde_json::to_string(&error).unwrap();
|
||||
let deserialized: PluginError = serde_json::from_str(&serialized).unwrap();
|
||||
assert_eq!(format!("{}", error), format!("{}", deserialized));
|
||||
assert_eq!(format!("{error}"), format!("{}", deserialized));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue