项目文件夹

文件
wehub-resource-sync 6cf6f95f58
CodeQL / Analyze (push) Has been cancelled
Sync to Gitee / Run (push) Has been cancelled
Go / build & test (1.25.x) (push) Has been cancelled
Go / build & test (1.26.x) (push) Has been cancelled
Lint / resolve module (push) Has been cancelled
Lint / lint module (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:39:43 +08:00

25 行
404 B
Go

package selector
import (
"context"
"testing"
)
func TestPeer(t *testing.T) {
p := Peer{
Node: mockWeightedNode{},
}
ctx := NewPeerContext(context.Background(), &p)
p2, ok := FromPeerContext(ctx)
if !ok || p2.Node == nil {
t.Fatalf(" no peer found!")
}
}
func TestNotPeer(t *testing.T) {
_, ok := FromPeerContext(context.Background())
if ok {
t.Fatalf("test no peer found peer!")
}
}