apicontext

This commit is contained in:
Michael McGuinness
2024-12-23 16:01:54 +00:00
parent ce5e566c9e
commit a54a70047b
129 changed files with 1107 additions and 693 deletions
-41
View File
@@ -1,41 +0,0 @@
package grpc_test
import (
"context"
"testing"
"gotemplate/api/grpc/spec"
"github.com/stretchr/testify/assert"
)
func TestName(t *testing.T) {
ctx := context.Background()
conn, cleanup := createDependencies(t, ctx)
defer cleanup()
client := spec.NewNameClient(conn)
name := "Doczy.ai"
_, err := client.Get(ctx, &spec.NameMessage{
Name: name,
})
assert.NotNil(t, err)
response, err := client.Add(ctx, &spec.NameMessage{
Name: name,
})
assert.Nil(t, err)
assert.Equal(t, name, response.Name)
response, err = client.Get(ctx, &spec.NameMessage{
Name: name,
})
assert.Nil(t, err)
assert.Equal(t, name, response.Name)
}
+27
View File
@@ -0,0 +1,27 @@
package grpc_test
import (
"context"
"testing"
"gotemplate/api/grpc/spec"
"github.com/stretchr/testify/assert"
)
func TestName(t *testing.T) {
ctx := context.Background()
conn, cleanup := createDependencies(t, ctx)
defer cleanup()
client := spec.NewQueryServiceClient(conn)
id := "sample_id"
_, err := client.Get(ctx, &spec.IdMessage{
Id: id,
})
assert.NotNil(t, err)
}