mirror of
https://github.com/hanzoai/base.git
synced 2026-10-21 03:41:50 +00:00
Adds collection/record/login/whoami/crons + daemon lifecycle + cluster (base-ha HA) + operator (K8s CRD) + config/status/self/rpc. Lux/cli network flags (--mainnet/--testnet/--devnet/--dev). All Base daemons (atsd-style binaries) get the full CLI for free via base.Start() or manual cmd.AddCommand(cmd.NewCLICommand()).
33 lines
643 B
Go
33 lines
643 B
Go
package cli
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestOperatorNetworkYAML(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
tests := []struct {
|
|
env Env
|
|
wantFile string
|
|
}{
|
|
{EnvMainnet, "mainnet-sfo.yaml"},
|
|
{EnvTestnet, "testnet.yaml"},
|
|
{EnvDevnet, "devnet.yaml"},
|
|
}
|
|
|
|
for _, tt := range tests {
|
|
t.Run(string(tt.env), func(t *testing.T) {
|
|
t.Parallel()
|
|
got := operatorNetworkYAML("/tmp/operator", tt.env)
|
|
if !strings.HasSuffix(got, tt.wantFile) {
|
|
t.Fatalf("expected suffix %s, got %s", tt.wantFile, got)
|
|
}
|
|
if !strings.Contains(got, "k8s/networks") {
|
|
t.Fatalf("expected k8s/networks in path, got %s", got)
|
|
}
|
|
})
|
|
}
|
|
}
|