19 lines
606 B
Go
19 lines
606 B
Go
package agent_execution_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"git.cin.su/m/Assistant/contracts/artifact"
|
|
)
|
|
|
|
func TestAgentArtifactAttestationRequiresProvenance(t *testing.T) {
|
|
attestation := artifact.AgentArtifactAttestation{ArtifactID: "artifact-1", ProducerRunID: "run-1", SourceRevision: "commit-1", WorktreeID: "worktree-1", ContentDigest: "sha256:artifact", TestEvidenceRef: "tests:1", CreatedAtUnixMillis: 10}
|
|
if err := attestation.Validate(); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
attestation.ContentDigest = ""
|
|
if err := attestation.Validate(); err == nil {
|
|
t.Fatal("expected missing digest rejection")
|
|
}
|
|
}
|