MCPcopy Create free account
hub / github.com/facebook/time / TestFetchChannelTarget_PPS

Function TestFetchChannelTarget_PPS

calnex/api/api_test.go:276–292  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

274}
275
276func 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
294func 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"

Callers

nothing calls this directly

Calls 3

FetchChannelTargetMethod · 0.95
NewAPIFunction · 0.85
CloseMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…