Add reference contracts to extractor metadata
This commit is contained in:
25
internal/framework/pipeline/module_test.go
Normal file
25
internal/framework/pipeline/module_test.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package pipeline
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/framework/contracts"
|
||||
)
|
||||
|
||||
func TestValidateModuleSpecRejectsReferenceSlotsForNonExtractors(t *testing.T) {
|
||||
err := validateModuleSpec("chunker", StageChunk, ModuleSpec{
|
||||
Key: "generic",
|
||||
Stage: StageChunk,
|
||||
ReferenceSlots: []contracts.ReferenceSlot{
|
||||
{Name: "roster"},
|
||||
},
|
||||
})
|
||||
|
||||
if err == nil {
|
||||
t.Fatal("validateModuleSpec() error = nil, want error")
|
||||
}
|
||||
if !strings.Contains(err.Error(), "reference slots") {
|
||||
t.Fatalf("validateModuleSpec() error = %q, want reference slots context", err.Error())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user