/loggerhead/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/loggerhead/trunk

« back to all changes in this revision

Viewing changes to loggerhead/tests/test_simple.py

test using the cache too.
one fails, this is https://bugs.launchpad.net/launchpad-bazaar/+bug/92435

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
    testutil.create_request('/')
19
19
    assert 'loggerhead branches' in cherrypy.response.body[0]
20
20
 
21
 
config_template = """
22
 
[project]
23
 
    [[branch]]
24
 
        branch_name = 'branch'
25
 
        folder = '%s'
26
 
"""
27
 
 
28
21
 
29
22
class TestWithSimpleTree(object):
 
23
    config_template = """
 
24
    [project]
 
25
        [[branch]]
 
26
            branch_name = 'branch'
 
27
            folder = '%(branch)s'
 
28
    """
30
29
    def setUp(self):
31
30
        self.old_bzrhome = bzrlib.osutils.set_or_unset_env('BZR_HOME', '')
32
31
        self.bzrbranch = tempfile.mkdtemp()
44
43
        self.msg = 'a very exciting commit message'
45
44
        self.revid = tree.commit(message=self.msg)
46
45
 
47
 
        ini = config_template%self.bzrbranch
 
46
        ini = self.config_template%dict(branch=self.bzrbranch)
48
47
 
49
48
        config = ConfigObj(ini.splitlines())
50
49
        cherrypy.root = Root(config)
84
83
        testutil.create_request('/project/branch/files')
85
84
        assert 'myfilename' in cherrypy.response.body[0]
86
85
 
 
86
class TestWithSimpleTreeAndCache(TestWithSimpleTree):
 
87
    config_template = """
 
88
    testing = True
 
89
    [project]
 
90
        [[branch]]
 
91
            branch_name = 'branch'
 
92
            folder = '%(branch)s'
 
93
            cachepath = '%(branch)s/cache'
 
94
    """