/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to tests/test_git_dir.py

Basic support for opening working trees.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Test the GitDir class"""
18
18
 
19
 
import subprocess
20
 
 
21
 
from bzrlib import bzrdir
 
19
from bzrlib import bzrdir, errors
22
20
 
23
21
from bzrlib.plugins.git import tests
24
 
from bzrlib.plugins.git import git_dir
 
22
from bzrlib.plugins.git import git_dir, git_workingtree
25
23
 
26
24
 
27
25
class TestGitDir(tests.TestCaseInTempDir):
34
32
        gd = bzrdir.BzrDir.open('.')
35
33
        self.assertIsInstance(gd, git_dir.GitDir)
36
34
 
 
35
    def test_open_workingtree(self):
 
36
        tests.run_git('init')
 
37
 
 
38
        gd = bzrdir.BzrDir.open('.')
 
39
        wt = gd.open_workingtree()
 
40
        self.assertIsInstance(wt, git_workingtree.GitWorkingTree)
 
41
 
 
42
    def test_open_workingtree_bare(self):
 
43
        tests.run_git('--bare', 'init')
 
44
 
 
45
        gd = bzrdir.BzrDir.open('.')
 
46
        self.assertRaises(errors.NoWorkingTree, gd.open_workingtree)
 
47
 
37
48
 
38
49
class TestGitDirFormat(tests.TestCaseInTempDir):
39
50