MCPcopy
hub / github.com/probelabs/goreplay / TestInputFileWithGET

Function TestInputFileWithGET

input_file_test.go:15–36  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

13)
14
15func TestInputFileWithGET(t *testing.T) {
16 input := NewTestInput()
17 rg := NewRequestGenerator([]PluginReader{input}, func() { input.EmitGET() }, 1)
18 readPayloads := []*Message{}
19
20 // Given a capture file with a GET request
21 expectedCaptureFile := CreateCaptureFile(rg)
22 defer expectedCaptureFile.TearDown()
23
24 // When the request is read from the capture file
25 err := ReadFromCaptureFile(expectedCaptureFile.file, 1, func(msg *Message) {
26 readPayloads = append(readPayloads, msg)
27 })
28
29 // The read request should match the original request
30 if err != nil {
31 t.Error(err)
32 } else if !expectedCaptureFile.PayloadsEqual(readPayloads) {
33 t.Error("Request read back from file should match")
34
35 }
36}
37
38func TestInputFileWithPayloadLargerThan64Kb(t *testing.T) {
39 input := NewTestInput()

Callers

nothing calls this directly

Calls 8

EmitGETMethod · 0.95
NewTestInputFunction · 0.85
NewRequestGeneratorFunction · 0.85
CreateCaptureFileFunction · 0.85
ReadFromCaptureFileFunction · 0.85
TearDownMethod · 0.80
PayloadsEqualMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected