You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
runner-go/registry/static_test.go

33 lines
658 B
Go

// Copyright 2019 Drone.IO Inc. All rights reserved.
// Use of this source code is governed by the Polyform License
// that can be found in the LICENSE file.
package registry
import (
"testing"
"git.awesome-for.me/liuzhiguo/drone-go/drone"
)
func TestStatic(t *testing.T) {
a := &drone.Registry{}
b := &drone.Registry{}
p := Static([]*drone.Registry{a, b})
out, err := p.List(noContext, nil)
if err != nil {
t.Error(err)
return
}
if len(out) != 2 {
t.Errorf("Expect combined registry output")
return
}
if out[0] != a {
t.Errorf("Unexpected registry at index 0")
}
if out[1] != b {
t.Errorf("Unexpected registry at index 1")
}
}