#NEWLINE# @ patch_object ( LXCHypervisor , '_GetCgroupSubsysDir' ) #NEWLINE# def testGetCgroupInstanceValue( self , getdir_mock ) : #NEWLINE# #INDENT# getdir_mock . return_value = utils . PathJoin ( getdir_mock . cgroot , 'memory' , 'lxc' ) #NEWLINE# self . assertEqual ( self . hv . _GetCgroupInstanceValue ( 'instance1' , 'memory.limit_in_bytes' ) , '128' ) #NEWLINE# getdir_mock . return_value = utils . PathJoin ( self . cgroot , 'cpuset' , 'some_group' , 'lxc' ) #NEWLINE# self . assertEqual ( self . hv . _GetCgroupInstanceValue ( 'instance1' , 'cpuset.cpus' ) , '0-1' )