~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): Chris Lamb
  • Date: 2007-03-09 03:58:13 UTC
  • Revision ID: james.westby@ubuntu.com-20070309035813-ouzb56usywzt0s7q
Tags: upstream-0.2+bzr31
ImportĀ upstreamĀ versionĀ 0.2+bzr31

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import os
 
2
from os import path
 
3
from shutil import rmtree
 
4
from tempfile import mkdtemp
 
5
 
 
6
from bzrlib import bzrdir, tests
 
7
 
 
8
from tracbzr import backend
 
9
 
 
10
class TracTestCase(tests.TestCase):
 
11
 
 
12
    def setUp(self):
 
13
        self.root = mkdtemp(prefix='trac+bzr-')
 
14
        self.old_cwd = os.getcwd()
 
15
        os.chdir(self.root)
 
16
        self.repo_root = path.join(self.root, 'repo')
 
17
        os.mkdir(self.repo_root)
 
18
        self.repo = bzrdir.BzrDir.create_repository(self.root, shared=True)
 
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()
 
22
 
 
23
    def trac_repo(self):
 
24
        return backend.BzrRepository(self.repo_root, None)
 
25
 
 
26
    def tearDown(self):
 
27
        os.chdir(self.old_cwd)
 
28
        rmtree(self.root)