def test_searching_other_buffer_size(self): log = LogReader(self.filename, LogReader.BUFFER_SIZE / 2) log.searcher.reset() positions = [ log.search(self.NEEDLE)[0] for _ in xrange(len(self.POSITIONS)) ] self.assertEqual(self.POSITIONS, positions)
def create(self, filename, key=None): if filename not in self.available: raise KeyError("No log with filename '%s' is available" % filename) key = (filename, key) r = LogReader(filename) self.readers[key] = r return r
def test_searching_other_buffer_size(self): log = LogReader(self.filename, LogReader.BUFFER_SIZE / 2) log.searcher.reset() positions = [log.search(self.NEEDLE)[0] for _ in xrange(len(self.POSITIONS))] self.assertEqual(self.POSITIONS, positions)