generated from VLADIMIR/template
fix double applications
This commit is contained in:
@@ -2,6 +2,7 @@ package tests
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/base64"
|
||||
"log"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -12,6 +13,7 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/metadata"
|
||||
)
|
||||
|
||||
func getClient() (pb.EveningDetectiveClient, func() error) {
|
||||
@@ -55,3 +57,25 @@ func getTeams(client pb.EveningDetectiveClient) (*pb.GetTeamsRsp, error) {
|
||||
req := &pb.GetTeamsReq{}
|
||||
return client.GetTeams(ctx, req)
|
||||
}
|
||||
|
||||
func addAction(
|
||||
t *testing.T,
|
||||
client pb.EveningDetectiveClient,
|
||||
name string,
|
||||
password string,
|
||||
place string,
|
||||
) {
|
||||
ctx, cancel := getContext()
|
||||
defer cancel()
|
||||
md := metadata.Pairs(
|
||||
"team-id", base64.StdEncoding.EncodeToString([]byte(name)),
|
||||
"password", password,
|
||||
)
|
||||
ctx = metadata.NewOutgoingContext(ctx, md)
|
||||
|
||||
req := &pb.AddActionReq{
|
||||
Place: place,
|
||||
}
|
||||
_, err := client.AddAction(ctx, req)
|
||||
assert.Nil(t, err, "запрос отправлен успешно")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user