本文整理汇总了Golang中github.com/bobtfish/AWSnycast/testhelpers.CheckOneMultiError函数的典型用法代码示例。如果您正苦于以下问题:Golang CheckOneMultiError函数的具体用法?Golang CheckOneMultiError怎么用?Golang CheckOneMultiError使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CheckOneMultiError函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: TestManageRoutesSpecValidateMissingCidr
func TestManageRoutesSpecValidateMissingCidr(t *testing.T) {
r := ManageRoutesSpec{
Instance: "SELF",
}
err := r.Validate(im1, &FakeRouteTableManager{}, "foo", emptyHealthchecks, emptyHealthchecks)
testhelpers.CheckOneMultiError(t, err, "cidr is not defined in foo")
}
示例2: TestHealthcheckValidateNoType
func TestHealthcheckValidateNoType(t *testing.T) {
h := Healthcheck{
Destination: "127.0.0.1",
}
err := h.Validate("foo", false)
testhelpers.CheckOneMultiError(t, err, "No healthcheck type set")
}
示例3: TestRouteTableFindSpecValidateNoConfig
func TestRouteTableFindSpecValidateNoConfig(t *testing.T) {
r := RouteTableFindSpec{
Type: "by_tag",
}
err := r.Validate("foo")
testhelpers.CheckOneMultiError(t, err, "Route find spec foo needs config")
}
示例4: TestHealthcheckValidateFailNoDestination
func TestHealthcheckValidateFailNoDestination(t *testing.T) {
h := Healthcheck{
Type: "ping",
}
err := h.Validate("foo", false)
testhelpers.CheckOneMultiError(t, err, "Healthcheck foo has no destination set")
}
示例5: TestGetFiltersListForSpecWrongType
func TestGetFiltersListForSpecWrongType(t *testing.T) {
c := make(map[string]interface{})
c["filters"] = "foo"
spec := RouteTableFindSpec{Config: c}
_, err := getFiltersListForSpec(spec)
testhelpers.CheckOneMultiError(t, err, "unexpected type string for 'filters' key")
}
示例6: TestConfigValidateEmptyRouteTables
func TestConfigValidateEmptyRouteTables(t *testing.T) {
r := make(map[string]*RouteTable)
c := Config{
RouteTables: r,
}
err := c.Validate(tim, rtm)
testhelpers.CheckOneMultiError(t, err, "No route_tables defined in config")
}
示例7: TestHealthcheckValidateRemoteWithDestFails
func TestHealthcheckValidateRemoteWithDestFails(t *testing.T) {
h := Healthcheck{
Type: "ping",
Destination: "127.0.0.1",
}
err := h.Validate("foo", true)
testhelpers.CheckOneMultiError(t, err, "Remote healthcheck foo cannot have destination set")
}
示例8: TestHealthcheckValidateFailDestination
func TestHealthcheckValidateFailDestination(t *testing.T) {
h := Healthcheck{
Type: "ping",
Destination: "www.google.com",
}
err := h.Validate("foo", false)
testhelpers.CheckOneMultiError(t, err, "Healthcheck foo destination 'www.google.com' does not parse as an IP address")
}
示例9: TestHealthcheckValidateFailType
func TestHealthcheckValidateFailType(t *testing.T) {
h := Healthcheck{
Type: "notping",
Destination: "127.0.0.1",
}
err := h.Validate("foo", false)
testhelpers.CheckOneMultiError(t, err, "Unknown healthcheck type 'notping' in foo")
}
示例10: TestManageRoutesSpecValidateBadCidr3
func TestManageRoutesSpecValidateBadCidr3(t *testing.T) {
r := ManageRoutesSpec{
Cidr: "foo",
Instance: "SELF",
}
err := r.Validate(im1, &FakeRouteTableManager{}, "bar", emptyHealthchecks, emptyHealthchecks)
testhelpers.CheckOneMultiError(t, err, "Could not parse invalid CIDR address: foo/32 in bar")
}
示例11: TestManageRoutesSpecValidateMissingRemoteHealthcheck
func TestManageRoutesSpecValidateMissingRemoteHealthcheck(t *testing.T) {
r := ManageRoutesSpec{
Cidr: "0.0.0.0/0",
Instance: "SELF",
RemoteHealthcheckName: "test",
}
err := r.Validate(im1, &FakeRouteTableManager{}, "foo", emptyHealthchecks, emptyHealthchecks)
testhelpers.CheckOneMultiError(t, err, "Route tables foo, route 0.0.0.0/0 cannot find remote healthcheck 'test'")
}
示例12: TestUpdateRemoteHealthchecksEmpty
func TestUpdateRemoteHealthchecksEmpty(t *testing.T) {
rs := &ManageRoutesSpec{
Cidr: "127.0.0.1",
RemoteHealthcheckName: "test",
}
err := rs.Validate(im1, &FakeRouteTableManager{}, "foo", emptyHealthchecks, emptyHealthchecks)
testhelpers.CheckOneMultiError(t, err, "Route tables foo, route 127.0.0.1/32 cannot find remote healthcheck 'test'")
rs.UpdateRemoteHealthchecks()
}
示例13: TestRouteTableFindSpecValidateNoType
func TestRouteTableFindSpecValidateNoType(t *testing.T) {
c := make(map[string]interface{})
c["key"] = "Name"
c["value"] = "private a"
r := RouteTableFindSpec{
Config: c,
}
err := r.Validate("foo")
testhelpers.CheckOneMultiError(t, err, "Route find spec foo needs a type key")
}
示例14: TestByTagRouteTableFindMissingValue
func TestByTagRouteTableFindMissingValue(t *testing.T) {
c := make(map[string]interface{})
c["key"] = "Name"
rts := RouteTableFindSpec{
Type: "by_tag",
Config: c,
}
rtf, err := rts.GetFilter()
assert.Nil(t, rtf)
testhelpers.CheckOneMultiError(t, err, "No value in config for by_tag route table finder")
}
示例15: TestRouteTableFindSpecValidateUnknownType
func TestRouteTableFindSpecValidateUnknownType(t *testing.T) {
c := make(map[string]interface{})
c["key"] = "Name"
c["value"] = "private a"
r := RouteTableFindSpec{
Type: "doesnotexist",
Config: c,
}
err := r.Validate("foo")
testhelpers.CheckOneMultiError(t, err, "Route find spec foo type 'doesnotexist' not known")
}