MCPcopy Create free account
hub / github.com/docker/go-plugins-helpers / TestCapabilitiesExchange

Function TestCapabilitiesExchange

network/api_test.go:152–164  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

150}
151
152func TestCapabilitiesExchange(t *testing.T) {
153 response, err := http.Get("http://localhost:32234/NetworkDriver.GetCapabilities")
154 if err != nil {
155 t.Fatal(err)
156 }
157 defer response.Body.Close()
158 body, err := io.ReadAll(response.Body)
159
160 expected := `{"Scope":"local","ConnectivityScope":"global"}`
161 if string(body) != expected+"\n" {
162 t.Fatalf("Expected %s, got %s\n", expected+"\n", string(body))
163 }
164}
165
166func TestCreateNetworkSuccess(t *testing.T) {
167 request := `{"NetworkID":"d76cfa51738e8a12c5eca71ee69e9d65010a4b48eaad74adab439be7e61b9aaf","Options":{"com.docker.network.generic":{}},"IPv4Data":[{"AddressSpace":"","Gateway":"172.18.0.1/16","Pool":"172.18.0.0/16"}],"IPv6Data":[]}`

Callers

nothing calls this directly

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…