MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / fixture

Function fixture

atomic-shacl/tests/profiles.rs:12–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10use atomic_shacl::*;
11
12fn fixture() -> (Vec<KgNode>, Vec<KgEdge>, String, String) {
13 let project = ProjectId::generate();
14 let session = iri::mint_session(&project, "session");
15 let turn = iri::mint_turn(&project, "session", 0);
16 let intent = iri::mint_intent(&project, "01ARZ3NDEKTSV4RRFFQ69G5FAV").unwrap();
17 let change = iri::mint_change(&Hash::of(b"change"));
18 let provenance = iri::mint_provenance(&Hash::of(b"provenance"));
19 let attestation = iri::mint_attestation(&Hash::of(b"attestation"));
20 let signer = format!("did:atomic:{}", project.to_base32());
21 let nodes = vec![
22 KgNode::new(&session, C::Session, "session", "fixture"),
23 KgNode::new(&turn, C::SessionTurn, "turn", "fixture").with_type(C::ManagedTurn),
24 // Only the subclass is asserted: standard SHACL subclass matching
25 // must satisfy the WorkIntent range without OWL materialization.
26 KgNode::new(&intent, C::FeatureIntent, "intent", "fixture"),
27 KgNode::new(&change, C::Change, "change", "fixture"),
28 KgNode::new(&provenance, C::ProvenanceGraph, "provenance", "fixture"),
29 KgNode::new(&attestation, C::Attestation, "attestation", "fixture"),
30 KgNode::new(&signer, C::Identity, "signer", "fixture"),
31 ];
32 let edges = vec![
33 KgEdge::new(&session, &turn, P::HasTurn),
34 KgEdge::new(&turn, &intent, P::HasPlan),
35 KgEdge::new(&turn, &change, P::GeneratedChange),
36 KgEdge::new(&turn, &provenance, P::TurnExplainedBy),
37 KgEdge::new(&change, &intent, P::Implements),
38 KgEdge::new(&change, &provenance, P::ChangeExplainedBy),
39 KgEdge::new(&change, &attestation, P::AttestedBy),
40 KgEdge::new(&attestation, &change, P::CoversChange),
41 KgEdge::new(&attestation, &session, P::AttestsSession),
42 KgEdge::new(&attestation, &signer, P::SignedBy),
43 KgEdge::new(
44 &attestation,
45 "https://atomic.dev/ns/workflow#Verified",
46 P::VerificationResult,
47 ),
48 ];
49 (nodes, edges, change, project.to_urn())
50}
51
52#[test]
53fn complete_workflow_conforms_to_both_profiles_and_reports_real_coverage() {

Calls 4

mint_turnFunction · 0.85
mint_intentFunction · 0.85
unwrapMethod · 0.45
to_urnMethod · 0.45

Tested by

no test coverage detected