#NEWLINE# @ patch ( 'salt.cloud.clouds.opennebula.list_vns' , MagicMock ( return_value = { #NEWLINE# #INDENT# 'test-vn' : { #NEWLINE# #INDENT# 'id' : '100' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# def test_get_vn_id_success( self ) : #NEWLINE# #INDENT# '\n        Tests that the function returns successfully.\n        ' #NEWLINE# mock_id = '100' #NEWLINE# mock_kwargs = { #NEWLINE# #INDENT# 'name' : 'test-vn' , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertEqual ( opennebula . get_vn_id ( mock_kwargs , 'foo' ) , self )