예제 #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'])
예제 #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'])
예제 #3
0
 def test_opens_proc_meminfo(self):
     util.get_mem_info()
     self.mock_open.assert_called_with('/proc/meminfo')
예제 #4
0
 def test_opens_proc_meminfo(self):
     util.get_mem_info()
     self.mock_open.assert_called_with('/proc/meminfo')