/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_dir.py

Merge new dulwich.

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
22
 
 
23
 
from bzrlib.plugins.git import tests
24
 
from bzrlib.plugins.git import git_dir
 
19
from bzrlib import bzrdir, errors
 
20
 
 
21
from bzrlib.plugins.git import dir, tests, workingtree
25
22
 
26
23
 
27
24
class TestGitDir(tests.TestCaseInTempDir):
32
29
        tests.run_git('init')
33
30
 
34
31
        gd = bzrdir.BzrDir.open('.')
35
 
        self.assertIsInstance(gd, git_dir.GitDir)
 
32
        self.assertIsInstance(gd, dir.GitDir)
 
33
 
 
34
    def test_open_workingtree(self):
 
35
        tests.run_git('init')
 
36
 
 
37
        gd = bzrdir.BzrDir.open('.')
 
38
        wt = gd.open_workingtree()
 
39
        self.assertIsInstance(wt, workingtree.GitWorkingTree)
 
40
 
 
41
    def test_open_workingtree_bare(self):
 
42
        tests.run_git('--bare', 'init')
 
43
 
 
44
        gd = bzrdir.BzrDir.open('.')
 
45
        self.assertRaises(errors.NoWorkingTree, gd.open_workingtree)
 
46
 
 
47
 
 
48
class TestGitDirFormat(tests.TestCaseInTempDir):
 
49
 
 
50
    _test_needs_features = [tests.GitCommandFeature]
 
51
 
 
52
    def setUp(self):
 
53
        super(TestGitDirFormat, self).setUp()
 
54
        self.format = dir.GitBzrDirFormat()
 
55
 
 
56
    def test_get_format_description(self):
 
57
        self.assertEquals("Local Git Repository",
 
58
                          self.format.get_format_description())
 
59