authenticate: add tests, fix signout (#45)

- authenticate: a bug where sign out failed to revoke the remote session
- docs: add code coverage to readme
- authenticate: Rename shorthand receiver variable name
- authenticate: consolidate sign in
This commit is contained in:
Bobby DeSimone 2019-02-14 00:01:50 -08:00 committed by GitHub
parent 35ee3247d7
commit 805f0198d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 1061 additions and 163 deletions

View file

@ -56,3 +56,24 @@ func TestMockAuthenticate(t *testing.T) {
}
}
func TestNew(t *testing.T) {
tests := []struct {
name string
serviceName string
opts *Options
wantErr bool
}{
{"grpc good", "grpc", &Options{Addr: "test", InternalAddr: "intranet.local", SharedSecret: "secret"}, false},
{"grpc missing shared secret", "grpc", &Options{Addr: "test", InternalAddr: "intranet.local", SharedSecret: ""}, true},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
_, err := New(tt.serviceName, tt.opts)
if (err != nil) != tt.wantErr {
t.Errorf("New() error = %v, wantErr %v", err, tt.wantErr)
return
}
})
}
}