Beispiel #1
0
 def test_parses_meminfo(self):
     contents = '\n'.join(self.cpuinfo) + '\n\n' + '\n'.join(self.cpuinfo)
     self.mock_open.return_value.__enter__.return_value.read.return_value = contents
     r = util.get_cpu_info()
     self.assertEqual(2, len(r))
     self.assertIn('processor', r[0])
     self.assertIn('processor', r[1])
Beispiel #2
0
 def test_parses_meminfo(self):
     contents = '\n'.join(self.cpuinfo) + '\n\n' + '\n'.join(self.cpuinfo)
     self.mock_open.return_value.__enter__.return_value.read.return_value = contents
     r = util.get_cpu_info()
     self.assertEqual(2, len(r))
     self.assertIn('processor', r[0])
     self.assertIn('processor', r[1])
Beispiel #3
0
 def test_opens_proc_meminfo(self):
     util.get_cpu_info()
     self.mock_open.assert_called_with('/proc/cpuinfo')
Beispiel #4
0
 def test_opens_proc_meminfo(self):
     util.get_cpu_info()
     self.mock_open.assert_called_with('/proc/cpuinfo')