Rename root, api and sdk module paths (imports, go.mod, go_package, ldflags, build scripts, buf configs) and regenerate protobuf/gateway code with the project's pinned toolchain. Wire identifiers unchanged. api gets a local replace for sdk; root/api/sdk require v0.1.0. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
33 lines
873 B
Go
33 lines
873 B
Go
// Copyright IBM Corp. 2020, 2026
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
package targets
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"repo.anhonesthost.net/CyberCoveLLC/threshold/internal/server"
|
|
"repo.anhonesthost.net/CyberCoveLLC/threshold/internal/types/scope"
|
|
pb "repo.anhonesthost.net/CyberCoveLLC/threshold/sdk/pbs/controller/api/resources/targets"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestWorkerList_Addresses(t *testing.T) {
|
|
addresses := []string{
|
|
"test1",
|
|
"test2",
|
|
"test3",
|
|
"test4",
|
|
}
|
|
var workerInfos []*pb.WorkerInfo
|
|
var tested server.WorkerList
|
|
for _, a := range addresses {
|
|
workerInfos = append(workerInfos, &pb.WorkerInfo{Address: a})
|
|
tested = append(tested, server.NewWorker(scope.Global.String(),
|
|
server.WithName(a),
|
|
server.WithAddress(a)))
|
|
}
|
|
assert.Equal(t, addresses, tested.Addresses())
|
|
assert.Equal(t, workerInfos, tested.WorkerInfos())
|
|
}
|