@@ -151,9 +151,53 @@ def test_get_bare_metal_create_options(self):
151151 def test_generate_create_dict_with_all_bare_metal_options (self ):
152152 package_id = 50
153153
154+ prices = [{
155+ 'id' : 888 ,
156+ 'price_id' : 1888 ,
157+ 'sort' : 0 ,
158+ 'setupFee' : 0 ,
159+ 'recurringFee' : 0 ,
160+ 'hourlyRecurringFee' : 0 ,
161+ 'oneTimeFee' : 0 ,
162+ 'laborFee' : 0 ,
163+ }]
164+
154165 self .client ['Product_Package' ].getAllObjects .return_value = [
155166 {'name' : 'Bare Metal Instance' , 'id' : package_id }]
156167
168+ self .client ['Product_Package' ].getRegions .return_value = [{
169+ 'location' : {
170+ 'locationPackageDetails' : [{
171+ 'deliveryTimeInformation' : 'Typically 2-4 hours' ,
172+ }],
173+ },
174+ 'keyname' : 'RANDOM_LOCATION' ,
175+ 'description' : 'Random unit testing location' ,
176+ }]
177+
178+ self .client ['Product_Package' ].getConfiguration .return_value = [{
179+ 'itemCategory' : {
180+ 'categoryCode' : 'random' ,
181+ 'name' : 'Random Category' ,
182+ },
183+ 'sort' : 0 ,
184+ 'orderStepId' : 1 ,
185+ 'isRequired' : 1 ,
186+ 'prices' : prices ,
187+ }]
188+
189+ self .client ['Product_Package' ].getItems .return_value = [{
190+ 'itemCategory' : {
191+ 'categoryCode' : 'random' ,
192+ 'name' : 'Random Category' ,
193+ },
194+ 'id' : 1000 ,
195+ 'description' : 'Astronaut Sloths' ,
196+ 'prices' : prices ,
197+ 'capacity' : 0 ,
198+ 'isRequired' : 1 ,
199+ }]
200+
157201 args = {
158202 'server' : 100 ,
159203 'hourly' : False ,
@@ -164,6 +208,7 @@ def test_generate_create_dict_with_all_bare_metal_options(self):
164208 'os' : 200 ,
165209 'port_speed' : 600 ,
166210 'bare_metal' : True ,
211+ 'hourly' : True ,
167212 }
168213
169214 assert_data = {
@@ -174,11 +219,13 @@ def test_generate_create_dict_with_all_bare_metal_options(self):
174219 }],
175220 'location' : args ['location' ],
176221 'packageId' : package_id ,
222+ 'hourlyBillingFlag' : True ,
177223 'prices' : [
178224 {'id' : args ['server' ]},
179225 {'id' : args ['disks' ][0 ]},
180226 {'id' : args ['os' ]},
181227 {'id' : args ['port_speed' ]},
228+ {'id' : prices [0 ]['price_id' ]},
182229 ],
183230 }
184231
0 commit comments