File tree Expand file tree Collapse file tree 3 files changed +27
-1
lines changed
Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,9 @@ def test_volume_detail_name_identifier(self):
111111 'storageType' : {
112112 'keyName' : {'operation' : '*= BLOCK_STORAGE' }
113113 },
114- 'username' : {'operation' : '_= SL-12345' }}}
114+ 'username' : {'operation' : '_= SL-12345' }
115+ }
116+ }
115117
116118 self .assert_called_with ('SoftLayer_Account' , 'getIscsiNetworkStorage' , filter = expected_filter )
117119 self .assert_called_with ('SoftLayer_Network_Storage' , 'getObject' , identifier = 100 )
Original file line number Diff line number Diff line change @@ -1030,3 +1030,15 @@ def test_setCredentialPassword(self):
10301030 def test_list_block_volume_limit (self ):
10311031 result = self .block .list_block_volume_limit ()
10321032 self .assertEqual (SoftLayer_Network_Storage .getVolumeCountLimits , result )
1033+
1034+ def test_get_ids_from_username (self ):
1035+ result = self .block ._get_ids_from_username ("test" )
1036+ self .assert_called_with ('SoftLayer_Account' , 'getIscsiNetworkStorage' )
1037+ self .assertEqual ([100 ], result )
1038+
1039+ def test_get_ids_from_username_empty (self ):
1040+ mock = self .set_mock ('SoftLayer_Account' , 'getIscsiNetworkStorage' )
1041+ mock .return_value = []
1042+ result = self .block ._get_ids_from_username ("test" )
1043+ self .assert_called_with ('SoftLayer_Account' , 'getIscsiNetworkStorage' )
1044+ self .assertEqual ([], result )
Original file line number Diff line number Diff line change @@ -879,3 +879,15 @@ def test_order_file_modified_endurance(self):
879879 def test_list_file_volume_limit (self ):
880880 result = self .file .list_file_volume_limit ()
881881 self .assertEqual (SoftLayer_Network_Storage .getVolumeCountLimits , result )
882+
883+ def test_get_ids_from_username (self ):
884+ result = self .file ._get_ids_from_username ("test" )
885+ self .assert_called_with ('SoftLayer_Account' , 'getNasNetworkStorage' )
886+ self .assertEqual ([1 ], result )
887+
888+ def test_get_ids_from_username_empty (self ):
889+ mock = self .set_mock ('SoftLayer_Account' , 'getNasNetworkStorage' )
890+ mock .return_value = []
891+ result = self .file ._get_ids_from_username ("test" )
892+ self .assert_called_with ('SoftLayer_Account' , 'getNasNetworkStorage' )
893+ self .assertEqual ([], result )
You can’t perform that action at this time.
0 commit comments