def CreateVm(self, array_of_stdout): vm = CreateTestLinuxVm() vm.RemoteHostCommandWithReturnCode = mock.Mock( side_effect=[(str(text), '') for text in array_of_stdout]) vm.CheckLsCpu = mock.Mock( return_value=linux_virtual_machine.LsCpuResults(self.lscpu_output)) return vm
def testMissingRequiredLsCpuEntries(self): with self.assertRaises(ValueError): linux_virtual_machine.LsCpuResults('')