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

Function TestFetchChannelProtocol_PPS

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

Source from the content-addressed store, hash-verified

220}
221
222func TestFetchChannelProtocol_PPS(t *testing.T) {
223 sampleResp := "measure/ch0/signal_type=1 PPS"
224 ts := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter,
225 r *http.Request) {
226 fmt.Fprintln(w, sampleResp)
227 }))
228 defer ts.Close()
229
230 parsed, _ := url.Parse(ts.URL)
231 calnexAPI, err := NewAPI(parsed.Host, true, time.Second)
232 require.NoError(t, err)
233 calnexAPI.Client = ts.Client()
234
235 probe, err := calnexAPI.FetchChannelProbe(ChannelA)
236 require.NoError(t, err)
237 require.Equal(t, ProbePPS, *probe)
238}
239
240func TestFetchChannelTarget_NTP(t *testing.T) {
241 sampleResp := "measure/ch9/ptp_synce/ntp/server_ip_ipv6=fd00:3116:301a::3e"

Callers

nothing calls this directly

Calls 3

FetchChannelProbeMethod · 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…