(t *testing.T)
| 274 | } |
| 275 | |
| 276 | func TestFetchChannelTarget_PPS(t *testing.T) { |
| 277 | sampleResp := "measure/ch0/signal_type=1 PPS" |
| 278 | ts := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, |
| 279 | r *http.Request) { |
| 280 | fmt.Fprintln(w, sampleResp) |
| 281 | })) |
| 282 | defer ts.Close() |
| 283 | |
| 284 | parsed, _ := url.Parse(ts.URL) |
| 285 | calnexAPI, err := NewAPI(parsed.Host, true, time.Second) |
| 286 | require.NoError(t, err) |
| 287 | calnexAPI.Client = ts.Client() |
| 288 | |
| 289 | target, err := calnexAPI.FetchChannelTarget(ChannelA, ProbePPS) |
| 290 | require.NoError(t, err) |
| 291 | require.Equal(t, "1 PPS", target) |
| 292 | } |
| 293 | |
| 294 | func TestFetchUsedChannels(t *testing.T) { |
| 295 | sampleResp := "[measure]\nch0\\used=Yes\nch0\\installed=1\nch7\\used=No\nch7\\installed=1\nch29\\used=Yes\nch29\\installed=0\nch30\\used=Yes\nch30\\installed=1\n" |
nothing calls this directly
no test coverage detected
searching dependent graphs…