Notify callers from the prepared execution snapshot
This commit is contained in:
20
internal/usecase/prepared_notification_test.go
Normal file
20
internal/usecase/prepared_notification_test.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package usecase
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"go.maximumdirect.net/promptkit/internal/domain"
|
||||
)
|
||||
|
||||
func TestPreparedNotificationChecksContextBeforeInvocation(t *testing.T) {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
cancel()
|
||||
called := false
|
||||
_, err := (&Runner{}).executePreparedRun(ctx, &domain.PreparedRun{}, func(context.Context, *domain.PreparedRun) { called = true }, false, nil, "", 0, "", time.Time{}, nil)
|
||||
if called || !errors.Is(err, context.Canceled) || !errors.Is(err, ErrLLMGenerate) {
|
||||
t.Fatalf("called=%v error=%v", called, err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user