@@ -134,6 +134,41 @@ def test_create(self, confirm_mock):
134
134
self .assert_called_with ('SoftLayer_Virtual_Guest' , 'createObject' ,
135
135
args = args )
136
136
137
+ @mock .patch ('SoftLayer.CLI.formatting.confirm' )
138
+ def test_create_with_integer_image_id (self , confirm_mock ):
139
+ confirm_mock .return_value = True
140
+ result = self .run_command (['vs' , 'create' ,
141
+ '--cpu=2' ,
142
+ '--domain=example.com' ,
143
+ '--hostname=host' ,
144
+ '--image=12345' ,
145
+ '--memory=1' ,
146
+ '--network=100' ,
147
+ '--billing=hourly' ,
148
+ '--datacenter=dal05' ])
149
+
150
+ self .assertEqual (result .exit_code , 0 )
151
+ self .assertEqual (json .loads (result .output ),
152
+ {'guid' : '1a2b3c-1701' ,
153
+ 'id' : 100 ,
154
+ 'created' : '2013-08-01 15:23:45' })
155
+
156
+ args = ({
157
+ 'datacenter' : {'name' : 'dal05' },
158
+ 'domain' : 'example.com' ,
159
+ 'hourlyBillingFlag' : True ,
160
+ 'localDiskFlag' : True ,
161
+ 'maxMemory' : 1024 ,
162
+ 'hostname' : 'host' ,
163
+ 'startCpus' : 2 ,
164
+ 'blockDeviceTemplateGroup' : {
165
+ 'globalIdentifier' : '0B5DEAF4-643D-46CA-A695-CECBE8832C9D' ,
166
+ },
167
+ 'networkComponents' : [{'maxSpeed' : '100' }]
168
+ },)
169
+ self .assert_called_with ('SoftLayer_Virtual_Guest' , 'createObject' ,
170
+ args = args )
171
+
137
172
@mock .patch ('SoftLayer.CLI.formatting.confirm' )
138
173
def test_dns_sync_both (self , confirm_mock ):
139
174
confirm_mock .return_value = True
0 commit comments