def testValidFile(self): tmpfile = self._CreateTempFile() for (data, exp) in [("123", 123), ("0\n", 0)]: utils.WriteFile(tmpfile, data=data) result = jstore._ReadNumericFile(tmpfile) self.assertEqual(result, exp)
def testNonExistingFile(self): result = jstore._ReadNumericFile("/tmp/this/file/does/not/exist") self.assertTrue(result is None)