# Path: duct/logs/follower.py
# class LogFollower(object):
#     def __init__(self, logfile, parser=None, tmp_path="/var/lib/duct/",
#                  history=False):
#     def cleanStore(self):
#     def storeLast(self):
#     def readLast(self):
#     def get_fn(self, fn, max_lines=None):
#     def get(self, max_lines=None):
# 
# Path: duct/logs/parsers.py
# class ApacheLogParserError(Exception):
# class ApacheLogParser(object):
#     def __init__(self, fmt):
#     def _parse_date(self, date):
#     def alias(self, field):
#     def _parse_format(self, fmt):
#     def parse(self, line):
#     def pattern(self):
#     def names(self):


from twisted.trial import unittest
from duct.logs import follower, parsers
import datetime
import os
        self.assertEqual(r2, [])
        self.assertEqual(r3[0], 'testing')

        log.close()

        # Move inode
        os.rename('test.log', 'testold.log')

        log = open('test.log', 'wt')
        log.write('foo2\nbar2\n')
        log.close()

        r = f.get()

        self.assertEqual(r[0], 'foo2')
        self.assertEqual(r[1], 'bar2')

        # Go backwards
        log = open('test.log', 'wt')
        log.write('foo3\n')
        log.close()

        r = f.get()

        self.assertEqual(r[0], 'foo3')

        os.unlink('test.log')
        os.unlink('testold.log')

    def test_apache_parser(self):

# Path: duct/logs/follower.py
# class LogFollower(object):
#     def __init__(self, logfile, parser=None, tmp_path="/var/lib/duct/",
#                  history=False):
#     def cleanStore(self):
#     def storeLast(self):
#     def readLast(self):
#     def get_fn(self, fn, max_lines=None):
#     def get(self, max_lines=None):
# 
# Path: duct/logs/parsers.py
# class ApacheLogParserError(Exception):
# class ApacheLogParser(object):
#     def __init__(self, fmt):
#     def _parse_date(self, date):
#     def alias(self, field):
#     def _parse_format(self, fmt):
#     def parse(self, line):
#     def pattern(self):
#     def names(self):


# Path: duct/tests/test_logs.py
from twisted.trial import unittest
from duct.logs import follower, parsers
import datetime
import os

        self.assertEqual(r2, [])
        self.assertEqual(r3[0], 'testing')

        log.close()

        # Move inode
        os.rename('test.log', 'testold.log')

        log = open('test.log', 'wt')
        log.write('foo2\nbar2\n')
        log.close()

        r = f.get()

        self.assertEqual(r[0], 'foo2')
        self.assertEqual(r[1], 'bar2')

        # Go backwards
        log = open('test.log', 'wt')
        log.write('foo3\n')
        log.close()

        r = f.get()

        self.assertEqual(r[0], 'foo3')

        os.unlink('test.log')
        os.unlink('testold.log')

    def test_apache_parser(self):

        log = parsers.ApacheLogParser('combined')