Add local source publication
This commit is contained in:
29
internal/publish/output_test.go
Normal file
29
internal/publish/output_test.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package publish
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"gitea.maximumdirect.net/eric/distributor/internal/bundle"
|
||||
"gitea.maximumdirect.net/eric/distributor/internal/config"
|
||||
)
|
||||
|
||||
func TestPlanSourceOutputsRejectsCollision(t *testing.T) {
|
||||
_, err := PlanSourceOutputs(Request{
|
||||
SourceBundle: bundle.Bundle{
|
||||
Manifest: bundle.Manifest{
|
||||
SchemaVersion: 1,
|
||||
ID: "bundle",
|
||||
Created: time.Date(2026, 5, 30, 11, 10, 0, 0, time.UTC),
|
||||
Files: []bundle.ManifestFile{
|
||||
{Path: "report.md", SHA256: "sha256:1111111111111111111111111111111111111111111111111111111111111111", Size: 1},
|
||||
{Path: "report.md", SHA256: "sha256:2222222222222222222222222222222222222222222222222222222222222222", Size: 1},
|
||||
},
|
||||
},
|
||||
},
|
||||
Publish: config.PublishPolicy{Source: true},
|
||||
})
|
||||
if err == nil {
|
||||
t.Fatal("PlanSourceOutputs() error = nil, want collision")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user