752fb2e2c0
Text Extraction Clean Up + Parallelization * merged_Call * directchildren * bitofimprovements * go * parallel * fixfullsuite * pondforconcurrency * comments * muchdone * bitsofclean * stabilisedtests * snappy * threadpooltests * childelements * testspassed
30 lines
753 B
Go
30 lines
753 B
Go
package test_test
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
|
|
"queryorchestration/internal/test"
|
|
|
|
"github.com/aws/aws-sdk-go-v2/service/textract"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestAssertStringToReader(t *testing.T) {
|
|
t.Run("pass", func(t *testing.T) {
|
|
mockT := &testing.T{}
|
|
test.AssertStringToReader(t, "hi", strings.NewReader("hi"))
|
|
assert.False(t, mockT.Failed())
|
|
})
|
|
t.Run("fail", func(t *testing.T) {
|
|
mockT := &testing.T{}
|
|
test.AssertStringToReader(mockT, "bye", strings.NewReader("hi"))
|
|
assert.True(t, mockT.Failed())
|
|
})
|
|
}
|
|
|
|
func TestGetTextractFileResponse(t *testing.T) {
|
|
out := test.GetTextractFileResponse(t, "../../assets/textract/helloWorld.gen")
|
|
assert.IsType(t, []map[string]*textract.AnalyzeDocumentOutput{}, out)
|
|
}
|