Merged in feature/shorttestsanddirtidy (pull request #26)

Add short tests and Tidy internal directories

* complete the tasks
This commit is contained in:
Michael McGuinness
2025-01-17 12:00:32 +00:00
parent b453f6cb23
commit fa95d733ca
84 changed files with 171 additions and 101 deletions
+33
View File
@@ -0,0 +1,33 @@
package queue_test
import (
"context"
"queryorchestration/internal/server/queue"
"queryorchestration/internal/test"
"testing"
"github.com/aws/aws-sdk-go-v2/service/sqs/types"
"github.com/stretchr/testify/assert"
)
func TestDelete(t *testing.T) {
if testing.Short() {
t.Skip("Skipping long test in short mode")
}
ctx := context.Background()
queueConfig, cleanup := test.CreateQueue(t, ctx, &test.CreateQueueConfig{})
defer cleanup()
cfg := &queue.Config{
URL: queueConfig.URL,
Client: queueConfig.Client,
}
err := queue.Send(ctx, cfg, "{}", map[string]types.MessageAttributeValue{})
assert.Nil(t, err)
message := test.AssertMessageWait(t, ctx, cfg, []string{})
err = queue.Delete(ctx, cfg, &message)
assert.Nil(t, err)
}