Skip to content
Snippets Groups Projects

Improve test coverage of rbac stuff

Merged Ghost User requested to merge 207-improve-test-coverage-of-rbac-stuff into develop
2 files
+ 32
10
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -2,7 +2,6 @@ package api
import (
"context"
"reflect"
"testing"
apb "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/rbac"
@@ -62,8 +61,18 @@ func TestLogout(t *testing.T) {
want *apb.LogoutResponse
wantErr bool
}{
// TODO: Add test cases.
// Not implemented yet!
{
name: "default log out",
args: args{
ctx: context.TODO(),
addr: testAPIEndpoint,
username: "testAdmin",
},
want: &apb.LogoutResponse{
Status: apb.Status_STATUS_OK,
},
wantErr: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
@@ -72,8 +81,9 @@ func TestLogout(t *testing.T) {
t.Errorf("Logout() error = %v, wantErr %v", err, tt.wantErr)
return
}
if !reflect.DeepEqual(got, tt.want) {
t.Errorf("Logout() = %v, want %v", got, tt.want)
if got != nil && got.Status != tt.want.Status {
t.Errorf("Role.CreateRoles() = %v, want %v", got, tt.want)
}
})
}
Loading