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

Function TestFetchChannelProtocol_NTP

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

Source from the content-addressed store, hash-verified

184}
185
186func TestFetchChannelProtocol_NTP(t *testing.T) {
187 sampleResp := "measure/ch9/ptp_synce/mode/probe_type=2"
188 ts := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter,
189 r *http.Request) {
190 fmt.Fprintln(w, sampleResp)
191 }))
192 defer ts.Close()
193
194 parsed, _ := url.Parse(ts.URL)
195 calnexAPI, err := NewAPI(parsed.Host, true, time.Second)
196 require.NoError(t, err)
197 calnexAPI.Client = ts.Client()
198
199 probe, err := calnexAPI.FetchChannelProbe(ChannelVP1)
200 require.NoError(t, err)
201 require.Equal(t, ProbeNTP, *probe)
202}
203
204func TestFetchChannelProtocol_PTP(t *testing.T) {
205 sampleResp := "measure/ch10/ptp_synce/mode/probe_type=0"

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…