#NEWLINE# def test_freecpu( self ) : #NEWLINE# #INDENT# '\n            Test to return an int representing the number\n            of unallocated cpus on this hypervisor\n        ' #NEWLINE# mock = MagicMock ( return_value = { #NEWLINE# #INDENT# 'free_cpus' : 1024 , #NEWLINE# #UNINDENT# } ) #NEWLINE# with patch . object ( xapi , 'node_info' , mock ) : #NEWLINE# #INDENT# self . assertEqual ( xapi . freecpu ( ) , 1024 )