def testReadProcValid(self): # we need a procfs entry which exists on every system and # with a predictable value. threadsMax = ksm._readProcFSInt('/proc/sys/kernel/threads-max') # assertGreater would be better, but requires python 2.7 # and python 2.6 is still around. self.assertTrue(threadsMax > 0)
def testReadProcNotInt(self): # what about unexpected content? self.assertEquals(ksm._readProcFSInt('/proc/version'), 0)
def testReadProcInexistent(self): # Do we deal correctly with not-existent paths? self.assertEquals(ksm._readProcFSInt('/proc/inexistent'), 0)