@@ -31,9 +31,15 @@ func Test_Linode_Provision(t *testing.T) {
31
31
returnedStackscript := & linodego.Stackscript {ID : 10 }
32
32
33
33
expectedInstanceOptions := linodego.InstanceCreateOptions {
34
- Label : "inlets-" + host .Name , StackScriptID : returnedStackscript .ID ,
35
- Image : host .OS , Region : host .Region , Type : host .Plan , RootPass : "testpass" ,
34
+ Label : host .Name ,
35
+ StackScriptID : returnedStackscript .ID ,
36
+ Image : host .OS ,
37
+ Region : host .Region ,
38
+ Type : host .Plan ,
39
+ RootPass : "testpass" ,
40
+ Tags : []string {"inlets" },
36
41
}
42
+
37
43
returnedInstance := & linodego.Instance {
38
44
ID : 42 ,
39
45
Status : linodego .InstanceBooting ,
@@ -43,19 +49,22 @@ func Test_Linode_Provision(t *testing.T) {
43
49
mockClient .EXPECT ().CreateInstance (gomock .Any ()).Return (returnedInstance , nil ).Times (1 ).
44
50
Do (func (instanceOptions linodego.InstanceCreateOptions ) {
45
51
if instanceOptions .Label != expectedInstanceOptions .Label {
46
- t .Fail ( )
52
+ t .Fatalf ( "Label didn't match" )
47
53
}
48
54
if instanceOptions .StackScriptID != expectedInstanceOptions .StackScriptID {
49
- t .Fail ( )
55
+ t .Fatalf ( "StackScriptID didn't match" )
50
56
}
51
57
if instanceOptions .Image != expectedInstanceOptions .Image {
52
- t .Fail ( )
58
+ t .Fatalf ( "Image didn't match" )
53
59
}
54
60
if instanceOptions .Region != expectedInstanceOptions .Region {
55
- t .Fail ( )
61
+ t .Fatalf ( "Region didn't match" )
56
62
}
57
63
if instanceOptions .Type != expectedInstanceOptions .Type {
58
- t .Fail ()
64
+ t .Fatalf ("Type didn't match" )
65
+ }
66
+ if len (instanceOptions .Tags ) != len (expectedInstanceOptions .Tags ) {
67
+ t .Fatalf ("tags don't match" )
59
68
}
60
69
})
61
70
provisionedHost , _ := provisioner .Provision (host )
0 commit comments