~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/tests/test_filechangecache.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2008-03-07 04:58:09 UTC
  • mfrom: (149.1.1 socket_host)
  • Revision ID: launchpad@pqm.canonical.com-20080307045809-10xzgg4o8hpu94gl
[r=mwhudson] patch from Mattias Eriksson to allow binding to a specific interface

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
        """