def detectsError(self, rx): if not self._file.closed: self._file.close() try: fstest.check(self._temp) except FormatError, msg: mo = re.search(rx, str(msg)) self.failIf(mo is None, "unexpected error: %s" % msg)
def detectsError(self, rx): if not self._file.closed: self._file.close() try: fstest.check(self._temp) except FormatError as msg: mo = re.search(rx, str(msg)) self.assertFalse(mo is None, "unexpected error: %s" % msg) else: self.fail("fstest did not detect corruption")
def noError(self): if not self._file.closed: self._file.close() fstest.check(self._temp)