#NEWLINE# @ mock . patch . object ( libvirt_utils , 'is_mounted' ) #NEWLINE# def test_libvirt_smbfs_driver( self , mock_is_mounted ) : #NEWLINE# #INDENT# mock_is_mounted . return_value = False #NEWLINE# libvirt_driver = smbfs . LibvirtSMBFSVolumeDriver ( self . fake_conn ) #NEWLINE# export_string = '//192.168.1.1/volumes' #NEWLINE# export_mnt_base = os . path . join ( self . mnt_base , utils . get_hash_str ( export_string ) ) #NEWLINE# connection_info = { #NEWLINE# #INDENT# 'data' : { #NEWLINE# #INDENT# 'export' : export_string , #NEWLINE# 'name' : self . name , #NEWLINE# 'options' : None , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# libvirt_driver . connect_volume ( connection_info , self . disk_info ) #NEWLINE# libvirt_driver . disconnect_volume ( connection_info , 'vde' ) #NEWLINE# expected_commands = [ ( 'mkdir' , '-p' , export_mnt_base ) , ( 'mount' , '-t' , 'cifs' , '-o' , 'username=guest' , export_string , export_string ) , ( 'umount' , export_mnt_base ) ] #NEWLINE# self . assertEqual ( expected_commands , self . executes )