예제 #1
0
 def test_freecpu(self):
     '''
         Test to return an int representing the number
         of unallocated cpus on this hypervisor
     '''
     mock = MagicMock(return_value={'free_cpus': 1024})
     with patch.object(xapi, "node_info", mock):
         self.assertEqual(xapi.freecpu(), 1024)
예제 #2
0
 def test_freecpu(self):
     '''
         Test to return an int representing the number
         of unallocated cpus on this hypervisor
     '''
     mock = MagicMock(return_value={'free_cpus': 1024})
     with patch.object(xapi, "node_info", mock):
         self.assertEqual(xapi.freecpu(), 1024)