Skip to content
Snippets Groups Projects

Stfaseid http refactor

Merged Ghost User requested to merge stfaseid_http_refactor into develop
All threads resolved!
1 file
+ 48
52
Compare changes
  • Side-by-side
  • Inline
package server
package server
import (
import (
 
"context"
"os"
"os"
 
"reflect"
"testing"
"testing"
"time"
"time"
 
pb "code.fbi.h-da.de/danet/api/go/gosdn/core"
ppb "code.fbi.h-da.de/danet/api/go/gosdn/pnd"
ppb "code.fbi.h-da.de/danet/api/go/gosdn/pnd"
spb "code.fbi.h-da.de/danet/api/go/gosdn/southbound"
spb "code.fbi.h-da.de/danet/api/go/gosdn/southbound"
"code.fbi.h-da.de/danet/api/go/gosdn/transport"
"code.fbi.h-da.de/danet/api/go/gosdn/transport"
@@ -171,59 +174,52 @@ func TestMain(m *testing.M) {
@@ -171,59 +174,52 @@ func TestMain(m *testing.M) {
func Test_pnd_Get(t *testing.T) {
func Test_pnd_Get(t *testing.T) {
removeExistingStores()
removeExistingStores()
// type args struct {
type args struct {
// ctx context.Context
ctx context.Context
// request *ppb.GetRequest
request *pb.GetPndRequest
// }
}
// tests := []struct {
tests := []struct {
// name string
name string
// args args
args args
// want []string
want pb.GetPndResponse
// wantErr bool
wantErr bool
// }{
}{
// {
{
// name: "get pnd",
name: "get pnd",
// args: args{
args: args{
// ctx: context.Background(),
ctx: context.Background(),
// request: &ppb.GetRequest{
request: &pb.GetPndRequest{
// Request: &ppb.GetRequest_Pnd{
Pid: []string{
// Pnd: &ppb.GetPnd{},
pndID},
// },
},
// Pid: pndID,
},
// },
want: pb.GetPndResponse{
// },
Pnd: []*ppb.PrincipalNetworkDomain{
// want: []string{
{Id: pndID,
// pndID,
Name: "test",
// ondID,
Description: "test"},
// sbiID,
},
// // pendingChangeID,
},
// // committedChangeID,
},
// },
}
// },
for _, tt := range tests {
// }
t.Run(tt.name, func(t *testing.T) {
// for _, tt := range tests {
p := core{
// t.Run(tt.name, func(t *testing.T) {
UnimplementedCoreServiceServer: pb.UnimplementedCoreServiceServer{},
// p := pndServer{
}
// UnimplementedPndServiceServer: ppb.UnimplementedPndServiceServer{},
resp, err := p.GetPnd(tt.args.ctx, tt.args.request)
// }
if (err != nil) != tt.wantErr {
// resp, err := p.Get(tt.args.ctx, tt.args.request)
t.Errorf("Get() error = %v, wantErr %v", err, tt.wantErr)
// if (err != nil) != tt.wantErr {
return
// t.Errorf("Get() error = %v, wantErr %v", err, tt.wantErr)
}
// return
// }
// got := []string{
got := resp.GetPnd()
// resp.Pnd.Id,
// resp.Pnd.Ond[0].Id,
if !reflect.DeepEqual(got, tt.want.Pnd) {
// resp.Pnd.Sbi[0].Id,
t.Errorf("Get() got = %v, want %v", got, tt.want.Pnd)
// // resp.Pnd.Change[0].Id,
}
// // resp.Pnd.Change[1].Id,
})
// }
}
// if !reflect.DeepEqual(got, tt.want) {
// t.Errorf("Get() got = %v, want %v", got, tt.want)
// }
// })
// }
}
}
func Test_pnd_Set(t *testing.T) {
func Test_pnd_Set(t *testing.T) {
Loading