~ubuntu-branches/debian/sid/trac-bzr/sid

« back to all changes in this revision

Viewing changes to tracbzr/tests/__init__.py

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2008-08-01 18:03:14 UTC
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20080801180314-wuii7mab1f3ilvhu
Tags: upstream-0.2+bzr45
ImportĀ upstreamĀ versionĀ 0.2+bzr45

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 
8
8
from tracbzr import backend
9
9
 
10
 
class TracTestCase(tests.TestCase):
11
 
 
 
10
class MultiBranchTracTestCase(tests.TestCase):
12
11
    def setUp(self):
13
12
        self.root = mkdtemp(prefix='trac+bzr-')
14
13
        self.old_cwd = os.getcwd()
15
14
        os.chdir(self.root)
16
15
        self.repo_root = path.join(self.root, 'repo')
17
16
        os.mkdir(self.repo_root)
18
 
        self.repo = bzrdir.BzrDir.create_repository(self.root, shared=True)
 
17
        dir = bzrdir.BzrDir.create(self.repo_root)
 
18
        self.repo = dir.create_repository()
19
19
        self.treedir = path.join(self.repo_root, 'tree')
20
 
        self.tree = bzrdir.BzrDir.create_branch_convenience(self.treedir,
21
 
            force_new_tree=True).bzrdir.open_workingtree()
 
20
        self.branch = bzrdir.BzrDir.create_branch_convenience(self.treedir,
 
21
            force_new_tree=True)
 
22
        self.tree = self.branch.bzrdir.open_workingtree()
22
23
 
23
24
    def trac_repo(self):
24
25
        return backend.BzrRepository(self.repo_root, None)
26
27
    def tearDown(self):
27
28
        os.chdir(self.old_cwd)
28
29
        rmtree(self.root)
 
30
 
 
31
 
 
32
class SingleBranchTracTestCase(tests.TestCase):
 
33
    def setUp(self):
 
34
        self.root = mkdtemp(prefix='trac+bzr-')
 
35
        self.old_cwd = os.getcwd()
 
36
        os.chdir(self.root)
 
37
        branch = bzrdir.BzrDir.create_branch_convenience(self.root, 
 
38
                        force_new_tree=True)
 
39
        self.tree = branch.bzrdir.open_workingtree()
 
40
        self.repo = branch.repository
 
41
        self.treedir = self.root
 
42
 
 
43
    def trac_repo(self):
 
44
        return backend.BzrRepository(self.root, None)
 
45
 
 
46
    def tearDown(self):
 
47
        os.chdir(self.old_cwd)
 
48
        rmtree(self.root)