mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 22:17:14 +00:00
gofmt
This commit is contained in:
parent
9010ef954c
commit
9f76f13205
@ -20,7 +20,7 @@ func TestFakeHandlerPath(t *testing.T) {
|
|||||||
path := "/foo/bar"
|
path := "/foo/bar"
|
||||||
body := "somebody"
|
body := "somebody"
|
||||||
|
|
||||||
req, err := http.NewRequest(method, server.URL + path, bytes.NewBufferString(body));
|
req, err := http.NewRequest(method, server.URL+path, bytes.NewBufferString(body))
|
||||||
expectNoError(t, err)
|
expectNoError(t, err)
|
||||||
client := http.Client{}
|
client := http.Client{}
|
||||||
_, err = client.Do(req)
|
_, err = client.Do(req)
|
||||||
@ -35,7 +35,7 @@ func TestFakeHandlerPathNoBody(t *testing.T) {
|
|||||||
method := "GET"
|
method := "GET"
|
||||||
path := "/foo/bar"
|
path := "/foo/bar"
|
||||||
|
|
||||||
req, err := http.NewRequest(method, server.URL + path, nil);
|
req, err := http.NewRequest(method, server.URL+path, nil)
|
||||||
expectNoError(t, err)
|
expectNoError(t, err)
|
||||||
client := http.Client{}
|
client := http.Client{}
|
||||||
_, err = client.Do(req)
|
_, err = client.Do(req)
|
||||||
@ -45,7 +45,7 @@ func TestFakeHandlerPathNoBody(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type fakeError struct {
|
type fakeError struct {
|
||||||
errors[] string
|
errors []string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *fakeError) Errorf(format string, args ...interface{}) {
|
func (f *fakeError) Errorf(format string, args ...interface{}) {
|
||||||
@ -59,7 +59,7 @@ func TestFakeHandlerWrongPath(t *testing.T) {
|
|||||||
path := "/foo/bar"
|
path := "/foo/bar"
|
||||||
fakeT := fakeError{}
|
fakeT := fakeError{}
|
||||||
|
|
||||||
req, err := http.NewRequest(method, server.URL + "/foo/baz", nil);
|
req, err := http.NewRequest(method, server.URL+"/foo/baz", nil)
|
||||||
expectNoError(t, err)
|
expectNoError(t, err)
|
||||||
client := http.Client{}
|
client := http.Client{}
|
||||||
_, err = client.Do(req)
|
_, err = client.Do(req)
|
||||||
@ -78,7 +78,7 @@ func TestFakeHandlerWrongMethod(t *testing.T) {
|
|||||||
path := "/foo/bar"
|
path := "/foo/bar"
|
||||||
fakeT := fakeError{}
|
fakeT := fakeError{}
|
||||||
|
|
||||||
req, err := http.NewRequest("PUT", server.URL + path, nil);
|
req, err := http.NewRequest("PUT", server.URL+path, nil)
|
||||||
expectNoError(t, err)
|
expectNoError(t, err)
|
||||||
client := http.Client{}
|
client := http.Client{}
|
||||||
_, err = client.Do(req)
|
_, err = client.Do(req)
|
||||||
@ -98,7 +98,7 @@ func TestFakeHandlerWrongBody(t *testing.T) {
|
|||||||
body := "somebody"
|
body := "somebody"
|
||||||
fakeT := fakeError{}
|
fakeT := fakeError{}
|
||||||
|
|
||||||
req, err := http.NewRequest(method, server.URL + path, bytes.NewBufferString(body));
|
req, err := http.NewRequest(method, server.URL+path, bytes.NewBufferString(body))
|
||||||
expectNoError(t, err)
|
expectNoError(t, err)
|
||||||
client := http.Client{}
|
client := http.Client{}
|
||||||
_, err = client.Do(req)
|
_, err = client.Do(req)
|
||||||
@ -119,7 +119,7 @@ func TestFakeHandlerNilBody(t *testing.T) {
|
|||||||
body := "somebody"
|
body := "somebody"
|
||||||
fakeT := fakeError{}
|
fakeT := fakeError{}
|
||||||
|
|
||||||
req, err := http.NewRequest(method, server.URL + path, nil);
|
req, err := http.NewRequest(method, server.URL+path, nil)
|
||||||
expectNoError(t, err)
|
expectNoError(t, err)
|
||||||
client := http.Client{}
|
client := http.Client{}
|
||||||
_, err = client.Do(req)
|
_, err = client.Do(req)
|
||||||
@ -130,5 +130,3 @@ func TestFakeHandlerNilBody(t *testing.T) {
|
|||||||
t.Errorf("Unexpected error set: %#v", fakeT.errors)
|
t.Errorf("Unexpected error set: %#v", fakeT.errors)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import (
|
|||||||
|
|
||||||
func TestMakeJSONString(t *testing.T) {
|
func TestMakeJSONString(t *testing.T) {
|
||||||
pod := api.Pod{
|
pod := api.Pod{
|
||||||
JSONBase: api.JSONBase{ ID: "foo" },
|
JSONBase: api.JSONBase{ID: "foo"},
|
||||||
Labels: map[string]string{
|
Labels: map[string]string{
|
||||||
"foo": "bar",
|
"foo": "bar",
|
||||||
"baz": "blah",
|
"baz": "blah",
|
||||||
@ -30,7 +30,7 @@ func TestHandleCrash(t *testing.T) {
|
|||||||
expect := 10
|
expect := 10
|
||||||
for i := 0; i < expect; i = i + 1 {
|
for i := 0; i < expect; i = i + 1 {
|
||||||
defer HandleCrash()
|
defer HandleCrash()
|
||||||
if i % 2 == 0 {
|
if i%2 == 0 {
|
||||||
panic("Test Panic")
|
panic("Test Panic")
|
||||||
}
|
}
|
||||||
count = count + 1
|
count = count + 1
|
||||||
@ -39,4 +39,3 @@ func TestHandleCrash(t *testing.T) {
|
|||||||
t.Errorf("Expected %d iterations, found %d", expect, count)
|
t.Errorf("Expected %d iterations, found %d", expect, count)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user