~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/tests/test_filechangecache.py

  • Committer: Martin Albisetti
  • Date: 2008-06-16 00:28:36 UTC
  • mto: (128.10.4 loggerhead.search)
  • mto: This revision was merged to the branch mainline in revision 182.
  • Revision ID: argentina@gmail.com-20080616002836-qsm1mkyyid4k0mqj
 * Remove text index caching
 * Remove revision caching
 * Remove timer to re-check cache every 6 hours
 * Tweak documentation and config file to reflect this
 * Add try: except: to searching

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
from loggerhead.changecache import FileChangeCache
7
7
 
8
 
 
9
 
class MockEntry(object):
10
 
 
 
8
class MockEntry:
11
9
    def __init__(self, revid):
12
10
        self.revid = revid
13
11
 
14
12
 
15
 
class MockHistory(object):
16
 
 
 
13
class MockHistory:
17
14
    def __init__(self):
18
15
        self.fetched_revids = set()
19
 
 
20
16
    def get_file_changes_uncached(self, entries):
21
17
        output = []
22
18
        for entry in entries:
29
25
 
30
26
    # setup_method and teardown_method are so i can run the tests with
31
27
    # py.test and take advantage of the error reporting.
32
 
 
33
28
    def setup_method(self, meth):
34
29
        self.setUp()
35
30
 
43
38
        for folder in self.cache_folders:
44
39
            shutil.rmtree(folder)
45
40
 
 
41
 
46
42
    def makeHistoryAndEntriesForRevids(self, revids, fill_cache_with=[]):
47
43
        cache_folder = tempfile.mkdtemp()
48
44
        self.cache_folders.append(cache_folder)
55
51
                                     if entry.revid in fill_cache_with])
56
52
        self.history.fetched_revids.clear()
57
53
 
 
54
 
58
55
    def test_empty_cache(self):
59
56
        """An empty cache passes all the revids through to the history object.
60
57
        """