mirror of
https://github.com/argoproj/argo-cd
synced 2026-05-21 00:08:46 +00:00
27 lines
516 B
Go
27 lines
516 B
Go
package cache
|
|
|
|
import (
|
|
"sync"
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestGetServerVersion(t *testing.T) {
|
|
now := time.Now()
|
|
cache := &liveStateCache{
|
|
lock: &sync.Mutex{},
|
|
clusters: map[string]*clusterInfo{
|
|
"http://localhost": {
|
|
syncTime: &now,
|
|
syncLock: &sync.Mutex{},
|
|
lock: &sync.Mutex{},
|
|
serverVersion: "123",
|
|
},
|
|
}}
|
|
|
|
version, err := cache.GetServerVersion("http://localhost")
|
|
assert.NoError(t, err)
|
|
assert.Equal(t, "123", version)
|
|
}
|