@@ -71,7 +71,8 @@ def test_volume_detail(self):
71
71
'Data Center' : 'dal05' ,
72
72
'Type' : 'ENDURANCE' ,
73
73
'ID' : 100 ,
74
- '# of Active Transactions' : '0' ,
74
+ '# of Active Transactions' : '1' ,
75
+ 'Ongoing Transaction' : 'This is a buffer time in which the customer may cancel the server' ,
75
76
'Replicant Count' : '1' ,
76
77
'Replication Status' : 'Replicant Volume Provisioning '
77
78
'has completed.' ,
@@ -601,6 +602,37 @@ def test_duplicate_order_hourly_billing(self, order_mock):
601
602
'Order #24602 placed successfully!\n '
602
603
' > Storage as a Service\n ' )
603
604
605
+ @mock .patch ('SoftLayer.BlockStorageManager.order_modified_volume' )
606
+ def test_modify_order_exception_caught (self , order_mock ):
607
+ order_mock .side_effect = ValueError ('order attempt failed, noooo!' )
608
+
609
+ result = self .run_command (['block' , 'volume-modify' , '102' , '--new-size=1000' ])
610
+
611
+ self .assertEqual (2 , result .exit_code )
612
+ self .assertEqual ('Argument Error: order attempt failed, noooo!' , result .exception .message )
613
+
614
+ @mock .patch ('SoftLayer.BlockStorageManager.order_modified_volume' )
615
+ def test_modify_order_order_not_placed (self , order_mock ):
616
+ order_mock .return_value = {}
617
+
618
+ result = self .run_command (['block' , 'volume-modify' , '102' , '--new-iops=1400' ])
619
+
620
+ self .assert_no_fail (result )
621
+ self .assertEqual ('Order could not be placed! Please verify your options and try again.\n ' , result .output )
622
+
623
+ @mock .patch ('SoftLayer.BlockStorageManager.order_modified_volume' )
624
+ def test_modify_order (self , order_mock ):
625
+ order_mock .return_value = {'placedOrder' : {'id' : 24602 , 'items' : [{'description' : 'Storage as a Service' },
626
+ {'description' : '1000 GBs' },
627
+ {'description' : '4 IOPS per GB' }]}}
628
+
629
+ result = self .run_command (['block' , 'volume-modify' , '102' , '--new-size=1000' , '--new-tier=4' ])
630
+
631
+ order_mock .assert_called_with ('102' , new_size = 1000 , new_iops = None , new_tier_level = 4 )
632
+ self .assert_no_fail (result )
633
+ self .assertEqual ('Order #24602 placed successfully!\n > Storage as a Service\n > 1000 GBs\n > 4 IOPS per GB\n ' ,
634
+ result .output )
635
+
604
636
def test_set_password (self ):
605
637
result = self .run_command (['block' , 'access-password' , '1234' , '--password=AAAAA' ])
606
638
self .assert_no_fail (result )
0 commit comments