10 func TestServiceUnmarshal(t *testing.T) {
11 f, err := os.Open("testdata/services.json")
16 resp, err := parseResponse(f)
27 LastCheckResult: CheckResult{
28 Output: "HTTP OK: HTTP/1.1 200 OK - 1714 bytes in 0.703 second response time ",
32 for _, r := range resp.Results {
33 if r.name() == "9p.io!http" {
37 if !reflect.DeepEqual(want, got) {
40 t.Logf("want %+v, got %+v", want, got)
43 func TestServiceMarshal(t *testing.T) {
44 want := `{"attrs":{"check_command":"http","display_name":"http"}}`
46 b, err := json.Marshal(Service{
53 LastCheckResult: CheckResult{
54 Output: "HTTP OK: HTTP/1.1 200 OK - 1714 bytes in 0.703 second response time ",
64 t.Log("want", want, "got", got)