TST: FileFilter tail tests

pull/483/head
Daniel Black 11 years ago
parent 5005719180
commit a03815facf

@ -568,6 +568,9 @@ class FileContainer:
def getFileName(self):
return self.__filename
def getPos(self):
return self.__pos
def open(self):
self.__handler = open(self.__filename)
# Set the file descriptor to be FD_CLOEXEC

@ -603,7 +603,13 @@ class GetFailures(unittest.TestCase):
def tearDown(self):
"""Call after every test case."""
def testTail(self):
self.filter.addLogPath(LogFile.FILENAME, tail=True)
self.assertEqual(self.filter.getLogPath()[-1].getPos(), 1653)
self.filter.getLogPath()[-1].close()
self.assertEqual(self.filter.getLogPath()[-1].readline(), "")
self.filter.delLogPath(LogFile.FILENAME)
self.assertEqual(self.filter.getLogPath(),[])
def testGetFailures01(self, filename=None, failures=None):
filename = filename or GetFailures.FILENAME_01

Loading…
Cancel
Save