mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 18:37:45 +08:00
remove test for deleted fuction
License: MIT Signed-off-by: keks <keks@cryptoscope.co>
This commit is contained in:
parent
fbc36b8962
commit
8294f0a345
@ -73,41 +73,3 @@ func TestCheckVersionOption(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestServerNameOption(t *testing.T) {
|
||||
type testcase struct {
|
||||
name string
|
||||
}
|
||||
|
||||
tcs := []testcase{
|
||||
{"go-ipfs/0.4.13"},
|
||||
{"go-ipfs/" + config.CurrentVersionNumber},
|
||||
}
|
||||
|
||||
assert := func(name string, exp, got interface{}) {
|
||||
if got != exp {
|
||||
t.Errorf("%s: got %q, expected %q", name, got, exp)
|
||||
}
|
||||
}
|
||||
|
||||
for _, tc := range tcs {
|
||||
t.Logf("%#v", tc)
|
||||
r := httptest.NewRequest("POST", "/", nil)
|
||||
|
||||
inner := http.NewServeMux()
|
||||
inner.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
// this block is intentionally left blank.
|
||||
})
|
||||
|
||||
mux, err := ServerNameOption(tc.name)(nil, nil, inner)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
w := httptest.NewRecorder()
|
||||
|
||||
mux.ServeHTTP(w, r)
|
||||
srvHdr := w.Header().Get("Server")
|
||||
assert("Server header", tc.name, srvHdr)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user