Skip to content

Commit

Permalink
Remove unneeded JSON from unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnelson committed Apr 14, 2017
1 parent f8221a5 commit da5d8e1
Showing 1 changed file with 1 addition and 50 deletions.
51 changes: 1 addition & 50 deletions plugins/inputs/kapacitor/kapacitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,7 @@ func TestErrorHandling(t *testing.T) {

func TestErrorHandling404(t *testing.T) {
badServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.URL.Path == "/endpoint" {
_, _ = w.Write([]byte(basicJSON))
} else {
w.WriteHeader(http.StatusNotFound)
}
w.WriteHeader(http.StatusNotFound)
}))
defer badServer.Close()

Expand All @@ -112,51 +108,6 @@ func TestErrorHandling404(t *testing.T) {
require.Equal(t, uint64(0), acc.NMetrics())
}

const basicJSON = `
{
"_1": {
"name": "foo",
"tags": {
"id": "ex1"
},
"values": {
"i": -1,
"f": 0.5,
"b": true,
"s": "string"
}
},
"ignored": {
"willBeRecorded": false
},
"ignoredAndNested": {
"hash": {
"is": "nested"
}
},
"array": [
"makes parsing more difficult than necessary"
],
"string": "makes parsing more difficult than necessary",
"_2": {
"name": "bar",
"tags": {
"id": "ex2"
},
"values": {
"x": "x"
}
},
"pointWithoutFields_willNotBeIncluded": {
"name": "asdf",
"tags": {
"id": "ex3"
},
"values": {}
}
}
`

const kapacitorReturn = `{
"cluster_id": "aaa1cb78-8277-4886-a8ea-4706bca20842",
"cmdline": ["./build/kapacitord","-config","/Users/ross/.kapacitor/config"],
Expand Down

0 comments on commit da5d8e1

Please sign in to comment.