committed by
GitHub
parent
980504b47e
commit
62eb4beed2
@@ -7,6 +7,7 @@ import (
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
utils "github.com/sashabaranov/go-openai/internal"
|
||||
"github.com/sashabaranov/go-openai/internal/test"
|
||||
"github.com/sashabaranov/go-openai/internal/test/checks"
|
||||
)
|
||||
@@ -33,7 +34,7 @@ func (b *failingErrorBuffer) Bytes() []byte {
|
||||
return []byte{}
|
||||
}
|
||||
|
||||
func (*failingUnMarshaller) unmarshal(_ []byte, _ any) error {
|
||||
func (*failingUnMarshaller) Unmarshal(_ []byte, _ any) error {
|
||||
return errTestUnmarshalerFailed
|
||||
}
|
||||
|
||||
@@ -62,7 +63,7 @@ func TestErrorAccumulatorReturnsUnmarshalerErrors(t *testing.T) {
|
||||
func TestErrorByteWriteErrors(t *testing.T) {
|
||||
accumulator := &defaultErrorAccumulator{
|
||||
buffer: &failingErrorBuffer{},
|
||||
unmarshaler: &jsonUnmarshaler{},
|
||||
unmarshaler: &utils.JSONUnmarshaler{},
|
||||
}
|
||||
err := accumulator.write([]byte("{"))
|
||||
if !errors.Is(err, errTestErrorAccumulatorWriteFailed) {
|
||||
@@ -91,7 +92,7 @@ func TestErrorAccumulatorWriteErrors(t *testing.T) {
|
||||
|
||||
stream.errAccumulator = &defaultErrorAccumulator{
|
||||
buffer: &failingErrorBuffer{},
|
||||
unmarshaler: &jsonUnmarshaler{},
|
||||
unmarshaler: &utils.JSONUnmarshaler{},
|
||||
}
|
||||
|
||||
_, err = stream.Recv()
|
||||
|
||||
Reference in New Issue
Block a user