plugins/vendor/github.com/Microsoft/hcsshim/hcn/hcnerrors_test.go
Nathan Gieseker 9a429d8d25 Windows: Updates Windows Vendoring
Updates windows dependent libraries for vendoing.
2019-01-23 18:43:18 -08:00

35 lines
726 B
Go

// +build integration
package hcn
import (
"testing"
)
func TestMissingNetworkByName(t *testing.T) {
_, err := GetNetworkByName("Not found name")
if err == nil {
t.Fatal("Error was not thrown.")
}
if !IsNotFoundError(err) {
t.Fatal("Unrelated error was thrown.")
}
if _, ok := err.(NetworkNotFoundError); !ok {
t.Fatal("Wrong error type was thrown.")
}
}
func TestMissingNetworkById(t *testing.T) {
// Random guid
_, err := GetNetworkByID("5f0b1190-63be-4e0c-b974-bd0f55675a42")
if err == nil {
t.Fatal("Unrelated error was thrown.")
}
if !IsNotFoundError(err) {
t.Fatal("Unrelated error was thrown.")
}
if _, ok := err.(NetworkNotFoundError); !ok {
t.Fatal("Wrong error type was thrown.")
}
}