(t *testing.T)
| 184 | } |
| 185 | |
| 186 | func 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 | |
| 204 | func TestFetchChannelProtocol_PTP(t *testing.T) { |
| 205 | sampleResp := "measure/ch10/ptp_synce/mode/probe_type=0" |
nothing calls this directly
no test coverage detected
searching dependent graphs…