MCPcopy
hub / github.com/SpectoLabs/hoverfly / TestImportFromURL

Function TestImportFromURL

core/import_test.go:114–132  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

112}
113
114func TestImportFromURL(t *testing.T) {
115 RegisterTestingT(t)
116
117 // reading file and preparing json payload
118 pairFile, err := os.Open(hoverflyIoSimulationPath)
119 Expect(err).To(BeNil())
120 pairFileBytes, err := io.ReadAll(pairFile)
121 Expect(err).To(BeNil())
122
123 // pretending this is the endpoint with given json
124 server, unit := testTools(200, string(pairFileBytes))
125 defer server.Close()
126
127 // importing payloads
128 err = unit.Import(server.URL)
129 Expect(err).To(BeNil())
130
131 Expect(unit.Simulation.GetMatchingPairs()).To(HaveLen(2))
132}
133
134func TestImportFromURLRedirect(t *testing.T) {
135 RegisterTestingT(t)

Callers

nothing calls this directly

Calls 3

testToolsFunction · 0.85
ImportMethod · 0.80
GetMatchingPairsMethod · 0.80

Tested by

no test coverage detected