Files
pve-exporter/proxmox/model_test.go
T
lostakj e5a5e6416b
Build Docker image on push / docker (push) Successful in 22s
Build and push Docker image on tag / docker (push) Successful in 22s
Added cluster mode metric
2026-08-17 21:29:09 +02:00

31 lines
580 B
Go

package proxmox
import "testing"
func TestPveClusterStatusGetClusterModeNumeric(t *testing.T) {
tests := []struct {
name string
status PveClusterStatus
want float64
}{
{
name: "cluster mode",
status: PveClusterStatus{Type: "cluster"},
want: 1,
},
{
name: "standalone node",
status: PveClusterStatus{},
want: 0,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := tt.status.GetClusterModeNumeric(); got != tt.want {
t.Fatalf("GetClusterModeNumeric() = %v, want %v", got, tt.want)
}
})
}
}