Debian Codegraph @

api/v1/lib/httpcli/httpmaster/util_test.go

raw symbols SCIP
1 package httpmaster
2
3 import (
4 "testing"
5
6 "github.com/mesos/mesos-go/api/v1/lib/master"
7 )
8
9 func TestClassifyResponse(t *testing.T) {
10 _, err := classifyResponse(nil)
11 if err == nil {
12 t.Fatal("expected error instead of nil")
13 }
14 for _, v := range master.Call_Type_value {
15 ct := master.Call_Type(v)
16 _, err = classifyResponse(&master.Call{Type: ct})
17 if ct == master.Call_UNKNOWN {
18 if err == nil {
19 t.Fatal("expected error instead of nil")
20 }
21 } else {
22 if err != nil {
23 t.Fatalf("unexpected error %v", err)
24 }
25 }
26 }
27 }