()
| 440 | |
| 441 | #[test] |
| 442 | fn test_duplicate_entry() { |
| 443 | let mut entry = create_registry_entry(); |
| 444 | entry.name = "module".to_string(); |
| 445 | entry.value = RegistryValue::WasmModule(WasmModuleRegistryValue { |
| 446 | wasm_artifact_id: *Uuid::new_v4().as_bytes(), |
| 447 | version: "1.0.0".to_string(), |
| 448 | dependencies: Vec::new(), |
| 449 | module_extra_chunks: None, |
| 450 | }); |
| 451 | |
| 452 | REGISTRY_REPOSITORY.insert(entry.id, entry.clone()); |
| 453 | |
| 454 | let input = RegistryEntryInput { |
| 455 | name: entry.fullname(), |
| 456 | description: "This is a test description for the module.".to_string(), |
| 457 | tags: Vec::new(), |
| 458 | categories: Vec::new(), |
| 459 | metadata: Default::default(), |
| 460 | value: control_panel_api::RegistryEntryValueInput::WasmModule( |
| 461 | control_panel_api::WasmModuleRegistryEntryValueInput { |
| 462 | version: "1.0.0".to_string(), |
| 463 | wasm_module: [0, 1, 3].to_vec(), |
| 464 | dependencies: Vec::new(), |
| 465 | module_extra_chunks: None, |
| 466 | }, |
| 467 | ), |
| 468 | }; |
| 469 | |
| 470 | let result = REGISTRY_SERVICE.create(input); |
| 471 | |
| 472 | assert!(result.is_err()); |
| 473 | } |
| 474 | |
| 475 | #[test] |
| 476 | fn test_latest_tag() { |
nothing calls this directly
no test coverage detected