From 1570d83456c9bb0bb7af3751b13dbea01b0a5843 Mon Sep 17 00:00:00 2001 From: Onur Filiz Date: Sun, 1 May 2016 17:12:29 -0700 Subject: [PATCH] Updated network plugin tests to use api constants --- network/plugin.go | 5 +---- network/plugin_test.go | 12 ++++++------ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/network/plugin.go b/network/plugin.go index 8c5f41990..052d123d9 100644 --- a/network/plugin.go +++ b/network/plugin.go @@ -8,14 +8,11 @@ import ( "net/http" "sync" - "github.com/Azure/Aqua/core" "github.com/Azure/Aqua/common" + "github.com/Azure/Aqua/core" "github.com/Azure/Aqua/log" ) -// Libnetwork network plugin endpoint type -const endpointType = "NetworkDriver" - // NetPlugin object and its interface type netPlugin struct { name string diff --git a/network/plugin_test.go b/network/plugin_test.go index 8f9bcfc2b..ceda2b68b 100644 --- a/network/plugin_test.go +++ b/network/plugin_test.go @@ -94,7 +94,7 @@ func TestGetCapabilities(t *testing.T) { var resp remoteApi.GetCapabilityResponse - req, err := http.NewRequest(http.MethodGet, "/NetworkDriver.GetCapabilities", nil) + req, err := http.NewRequest(http.MethodGet, getCapabilitiesPath, nil) if err != nil { t.Fatal(err) } @@ -117,12 +117,12 @@ func TestCreateNetwork(t *testing.T) { var resp remoteApi.CreateNetworkResponse info := &remoteApi.CreateNetworkRequest{ - NetworkID: "N1", + NetworkID: "N1", } json.NewEncoder(&body).Encode(info) - req, err := http.NewRequest(http.MethodGet, "/NetworkDriver.CreateNetwork", &body) + req, err := http.NewRequest(http.MethodGet, createNetworkPath, &body) if err != nil { t.Fatal(err) } @@ -145,12 +145,12 @@ func TestDeleteNetwork(t *testing.T) { var resp remoteApi.DeleteNetworkResponse info := &remoteApi.DeleteNetworkRequest{ - NetworkID: "N1", + NetworkID: "N1", } json.NewEncoder(&body).Encode(info) - req, err := http.NewRequest(http.MethodGet, "/NetworkDriver.DeleteNetwork", &body) + req, err := http.NewRequest(http.MethodGet, deleteNetworkPath, &body) if err != nil { t.Fatal(err) } @@ -179,7 +179,7 @@ func TestEndpointOperInfo(t *testing.T) { json.NewEncoder(&body).Encode(info) - req, err := http.NewRequest(http.MethodGet, "/NetworkDriver.EndpointOperInfo", &body) + req, err := http.NewRequest(http.MethodGet, endpointOperInfoPath, &body) if err != nil { t.Fatal(err) }