File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -43,9 +43,6 @@ func TestCache_GetRepoConnectionState(t *testing.T) {
43
43
// populate cache
44
44
err = cache .SetRepoConnectionState ("my-repo" , "some-project" , & ConnectionState {Status : "my-project-state" })
45
45
require .NoError (t , err )
46
- // cache miss
47
- _ , err = cache .GetRepoConnectionState ("other-repo" , "" )
48
- assert .Equal (t , ErrCacheMiss , err )
49
46
// cache hit
50
47
value , err := cache .GetRepoConnectionState ("my-repo" , "" )
51
48
require .NoError (t , err )
Original file line number Diff line number Diff line change @@ -59,6 +59,24 @@ func TestCache_GetAppResourcesTree(t *testing.T) {
59
59
assert .Equal (t , & ApplicationTree {Nodes : []ResourceNode {{}}}, value )
60
60
}
61
61
62
+ func TestCache_GetClusterInfo (t * testing.T ) {
63
+ cache := newFixtures ().Cache
64
+ // cache miss
65
+ res := & ClusterInfo {}
66
+ err := cache .GetClusterInfo ("http://minikube" , res )
67
+ assert .Equal (t , ErrCacheMiss , err )
68
+ // populate cache
69
+ err = cache .SetClusterInfo ("http://kind-cluster" , & ClusterInfo {ServerVersion : "0.24.0" })
70
+ require .NoError (t , err )
71
+ // cache miss
72
+ err = cache .GetClusterInfo ("http://kind-clusterss" , res )
73
+ assert .Equal (t , ErrCacheMiss , err )
74
+ // cache hit
75
+ err = cache .GetClusterInfo ("http://kind-cluster" , res )
76
+ require .NoError (t , err )
77
+ assert .Equal (t , & ClusterInfo {ServerVersion : "0.24.0" }, res )
78
+ }
79
+
62
80
func TestAddCacheFlagsToCmd (t * testing.T ) {
63
81
cache , err := AddCacheFlagsToCmd (& cobra.Command {})()
64
82
require .NoError (t , err )
You can’t perform that action at this time.
0 commit comments