Ejemplo n.º 1
0
 def test_parses_meminfo(self):
     self.mock_open.return_value.__enter__.return_value.read.return_value = \
         '\n'.join(self.meminfo)
     r = util.get_mem_info()
     self.assertEqual('10000000 kB', r['MemTotal'])
     self.assertEqual('4000000 kB', r['MemFree'])
     self.assertEqual('1000000 kB', r['Buffers'])
     self.assertEqual('4000000 kB', r['Cached'])
Ejemplo n.º 2
0
 def test_parses_meminfo(self):
     self.mock_open.return_value.__enter__.return_value.read.return_value = \
         '\n'.join(self.meminfo)
     r = util.get_mem_info()
     self.assertEqual('10000000 kB', r['MemTotal'])
     self.assertEqual('4000000 kB', r['MemFree'])
     self.assertEqual('1000000 kB', r['Buffers'])
     self.assertEqual('4000000 kB', r['Cached'])
Ejemplo n.º 3
0
 def test_opens_proc_meminfo(self):
     util.get_mem_info()
     self.mock_open.assert_called_with('/proc/meminfo')
Ejemplo n.º 4
0
 def test_opens_proc_meminfo(self):
     util.get_mem_info()
     self.mock_open.assert_called_with('/proc/meminfo')