def test_uneven_division(self): self.meminfo['MemFree'] = '3333333 kB' self.meminfo['Buffers'] = '1111111 kB' self.meminfo['Cached'] = '1111111 kB' r = util.get_availmem(self.meminfo, 'M') self.assertEqual(5555, r)
def test_returns_gigabytes(self): r = util.get_availmem(self.meminfo, 'G') self.assertEqual(9, r)
def test_returns_megabytes(self): r = util.get_availmem(self.meminfo, 'M') self.assertEqual(9000, r)