MCPcopy Index your code
hub / github.com/imroc/req / TestEnableDumpAllToFile

Function TestEnableDumpAllToFile

client_test.go:680–692  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

678}
679
680func TestEnableDumpAllToFile(t *testing.T) {
681 c := tc()
682 dumpFile := "tmp_test_dump_file"
683 c.EnableDumpAllToFile(tests.GetTestFilePath(dumpFile))
684 resp, err := c.R().SetBody("test body").Post("/")
685 assertSuccess(t, resp, err)
686 dump := string(getTestFileContent(t, dumpFile))
687 os.Remove(tests.GetTestFilePath(dumpFile))
688 tests.AssertContains(t, dump, "user-agent", true)
689 tests.AssertContains(t, dump, "test body", true)
690 tests.AssertContains(t, dump, "date", true)
691 tests.AssertContains(t, dump, "testpost: text response", true)
692}
693
694func TestEnableDumpAllAsync(t *testing.T) {
695 c := tc()

Callers

nothing calls this directly

Calls 9

GetTestFilePathFunction · 0.92
AssertContainsFunction · 0.92
tcFunction · 0.85
assertSuccessFunction · 0.85
getTestFileContentFunction · 0.85
EnableDumpAllToFileMethod · 0.80
RMethod · 0.80
PostMethod · 0.45
SetBodyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…