#NEWLINE# @ mock . patch . object ( volumeops . VolumeOps , 'parse_disk_qos_specs' ) #NEWLINE# def test_get_storage_qos_specs( self , mock_parse_specs ) : #NEWLINE# #INDENT# fake_extra_specs = { #NEWLINE# #INDENT# 'spec_key' : 'spec_value' , #NEWLINE# 'storage_qos:min_bytes_sec' : mock . sentinel . min_bytes_sec , #NEWLINE# 'storage_qos:max_bytes_sec' : mock . sentinel . max_bytes_sec , #NEWLINE# #UNINDENT# } #NEWLINE# mock_instance = mock . Mock ( flavor = { #NEWLINE# #INDENT# 'extra_specs' : fake_extra_specs , #NEWLINE# #UNINDENT# } ) #NEWLINE# ret_val = self . _vmops . _get_storage_qos_specs ( mock_parse_specs ) #NEWLINE# expected_qos_specs_dict = { #NEWLINE# #INDENT# 'min_bytes_sec' : mock . sentinel . min_bytes_sec , #NEWLINE# 'max_bytes_sec' : mock . sentinel . max_bytes_sec , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertEqual ( mock_parse_specs . return_value , ret_val ) #NEWLINE# mock_parse_specs . assert_called_once_with ( expected_qos_specs_dict )