@@ -44,6 +44,9 @@ def test_list_block_volumes(self):
4444
4545 self .assert_called_with ('SoftLayer_Account' , 'getIscsiNetworkStorage' )
4646
47+ result = self .block .list_block_volumes (datacenter = "dal09" , storage_type = "Endurance" , username = "username" )
48+ self .assert_called_with ('SoftLayer_Account' , 'getIscsiNetworkStorage' )
49+
4750 def test_get_block_volume_access_list (self ):
4851 result = self .block .get_block_volume_access_list (100 )
4952
@@ -133,6 +136,47 @@ def test_cancel_snapshot_immediately(self):
133136 identifier = 123 ,
134137 )
135138
139+ def test_cancel_snapshot_exception_1 (self ):
140+ mock = self .set_mock ('SoftLayer_Network_Storage' , 'getObject' )
141+ mock .return_value = {
142+ 'capacityGb' : 20 ,
143+ 'snapshotCapacityGb' : '10' ,
144+ 'schedules' : [{
145+ 'id' : 7770 ,
146+ 'type' : {'keyname' : 'SNAPSHOT_WEEKLY' }
147+ }],
148+ 'billingItem' : {
149+ 'categoryCode' : 'storage_service_enterprise' ,
150+ 'cancellationDate' : '2016-09-04T22:00:00-07:00'
151+ }
152+ }
153+ self .assertRaises (
154+ exceptions .SoftLayerError ,
155+ self .block .cancel_snapshot_space ,
156+ 12345 ,
157+ immediate = True
158+ )
159+
160+ def test_cancel_snapshot_exception_2 (self ):
161+ mock = self .set_mock ('SoftLayer_Network_Storage' , 'getObject' )
162+ mock .return_value = {
163+ 'capacityGb' : 20 ,
164+ 'snapshotCapacityGb' : '10' ,
165+ 'schedules' : [{
166+ 'id' : 7770 ,
167+ 'type' : {'keyname' : 'SNAPSHOT_WEEKLY' }
168+ }],
169+ 'billingItem' : {
170+ 'activeChildren' : []
171+ }
172+ }
173+ self .assertRaises (
174+ exceptions .SoftLayerError ,
175+ self .block .cancel_snapshot_space ,
176+ 12345 ,
177+ immediate = True
178+ )
179+
136180 def test_replicant_failover (self ):
137181 result = self .block .failover_to_replicant (1234 , 5678 , immediate = True )
138182
@@ -595,6 +639,26 @@ def test_order_snapshot_space(self):
595639 'setupFee' : '1' }],
596640 },
597641 )
642+ result = self .block .order_snapshot_space (100 , 5 , None , True )
643+
644+ self .assertEqual (
645+ result ,
646+ {
647+ 'orderId' : 1234 ,
648+ 'orderDate' : '2013-08-01 15:23:45' ,
649+ 'prices' : [{
650+ 'hourlyRecurringFee' : '2' ,
651+ 'id' : 1 ,
652+ 'item' : {'description' : 'this is a thing' , 'id' : 1 },
653+ 'laborFee' : '2' ,
654+ 'oneTimeFee' : '2' ,
655+ 'oneTimeFeeTax' : '.1' ,
656+ 'quantity' : 1 ,
657+ 'recurringFee' : '2' ,
658+ 'recurringFeeTax' : '.1' ,
659+ 'setupFee' : '1' }],
660+ },
661+ )
598662
599663 def test_order_snapshot_space_invalid_category (self ):
600664 mock = self .set_mock ('SoftLayer_Product_Package' , 'getAllObjects' )
0 commit comments