Skip to content

Commit 7dfc976

Browse files
added coverage for SetDependencies
1 parent e8f5461 commit 7dfc976

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

minikube/service/minikube_client_test.go

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,59 @@ func TestMinikubeClient_SetConfig(t *testing.T) {
345345
}
346346
}
347347

348+
func TestMinikubeClient_SetDependencies(t *testing.T) {
349+
ctrl := gomock.NewController(t)
350+
351+
type fields struct {
352+
clusterConfig config.ClusterConfig
353+
clusterName string
354+
addons []string
355+
isoUrls []string
356+
deleteOnFailure bool
357+
nodes int
358+
TfCreationLock *sync.Mutex
359+
K8sVersion string
360+
nRunner Node
361+
dLoader Downloader
362+
}
363+
type args struct {
364+
dep MinikubeClientDeps
365+
}
366+
tests := []struct {
367+
name string
368+
fields fields
369+
args args
370+
}{
371+
{
372+
name: "Should Set Dependencies",
373+
fields: fields{},
374+
args: args{
375+
dep: MinikubeClientDeps{
376+
Node: NewMockNode(ctrl),
377+
Downloader: NewMockDownloader(ctrl),
378+
},
379+
},
380+
},
381+
}
382+
for _, tt := range tests {
383+
t.Run(tt.name, func(t *testing.T) {
384+
e := &MinikubeClient{
385+
clusterConfig: tt.fields.clusterConfig,
386+
clusterName: tt.fields.clusterName,
387+
addons: tt.fields.addons,
388+
isoUrls: tt.fields.isoUrls,
389+
deleteOnFailure: tt.fields.deleteOnFailure,
390+
nodes: tt.fields.nodes,
391+
TfCreationLock: tt.fields.TfCreationLock,
392+
K8sVersion: tt.fields.K8sVersion,
393+
nRunner: tt.fields.nRunner,
394+
dLoader: tt.fields.dLoader,
395+
}
396+
e.SetDependencies(tt.args.dep)
397+
})
398+
}
399+
}
400+
348401
func getProvisionerFailure(ctrl *gomock.Controller) Node {
349402
nRunnerProvisionFailure := NewMockNode(ctrl)
350403

0 commit comments

Comments
 (0)