Updated network plugin tests to use api constants

This commit is contained in:
Onur Filiz 2016-05-01 17:12:29 -07:00
Родитель 31bf4fbcbb
Коммит 1570d83456
2 изменённых файлов: 7 добавлений и 10 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -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)
}