MCPcopy Create free account
hub / github.com/dfinity/orbit / test_get_artifact

Function test_get_artifact

core/control-panel/impl/src/controllers/artifact.rs:54–71  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52
53 #[tokio::test]
54 async fn test_get_artifact() {
55 let artifact_data = b"hello world";
56 let artifact_id = ARTIFACT_SERVICE.create(artifact_data.to_vec()).unwrap();
57
58 let response = CONTROLLER
59 .get_artifact(GetArtifactInput {
60 artifact_id: Uuid::from_bytes(artifact_id).to_string(),
61 })
62 .await
63 .unwrap();
64
65 assert_eq!(
66 response.artifact.id,
67 Uuid::from_bytes(artifact_id).to_string()
68 );
69 assert_eq!(response.artifact.size, artifact_data.len() as u64);
70 assert_eq!(response.artifact.artifact, artifact_data);
71 }
72
73 #[tokio::test]
74 async fn test_get_artifact_invalid_id() {

Callers

nothing calls this directly

Calls 3

to_vecMethod · 0.80
get_artifactMethod · 0.80
createMethod · 0.45

Tested by

no test coverage detected