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

Function TestFetchChannelProtocol_PTP

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

Source from the content-addressed store, hash-verified

202}
203
204func TestFetchChannelProtocol_PTP(t *testing.T) {
205 sampleResp := "measure/ch10/ptp_synce/mode/probe_type=0"
206 ts := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter,
207 r *http.Request) {
208 fmt.Fprintln(w, sampleResp)
209 }))
210 defer ts.Close()
211
212 parsed, _ := url.Parse(ts.URL)
213 calnexAPI, err := NewAPI(parsed.Host, true, time.Second)
214 require.NoError(t, err)
215 calnexAPI.Client = ts.Client()
216
217 probe, err := calnexAPI.FetchChannelProbe(ChannelVP2)
218 require.NoError(t, err)
219 require.Equal(t, ProbePTP, *probe)
220}
221
222func TestFetchChannelProtocol_PPS(t *testing.T) {
223 sampleResp := "measure/ch0/signal_type=1 PPS"

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…