MCPcopy Index your code
hub / github.com/koding/kite / TestRegisterMachine

Function TestRegisterMachine

kontrol/kontrol_test.go:161–178  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

159}
160
161func TestRegisterMachine(t *testing.T) {
162 key, err := kon.registerUser("foo", testkeys.Public, testkeys.Private)
163 if err != nil {
164 t.Errorf(err.Error())
165 return
166 }
167
168 claims := &kitekey.KiteClaims{}
169
170 _, err = jwt.ParseWithClaims(key, claims, kitekey.GetKontrolKey)
171 if err != nil {
172 t.Fatalf(err.Error())
173 }
174
175 if claims.Subject != "foo" {
176 t.Fatalf("invalid username: %s", claims.Subject)
177 }
178}
179
180func TestRegisterDenyEvil(t *testing.T) {
181 // TODO(rjeczalik): use sentinel error value instead

Callers

nothing calls this directly

Calls 2

registerUserMethod · 0.80
ErrorMethod · 0.65

Tested by

no test coverage detected