/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

More performance hacking, introduce sqlite cache, escape characters in commits that break serializers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Test the GitDir class"""
18
18
 
19
 
from bzrlib import bzrdir, errors
20
 
 
21
 
from bzrlib.plugins.git import dir, tests, workingtree
 
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
22
25
 
23
26
 
24
27
class TestGitDir(tests.TestCaseInTempDir):
29
32
        tests.run_git('init')
30
33
 
31
34
        gd = bzrdir.BzrDir.open('.')
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
 
 
 
35
        self.assertIsInstance(gd, git_dir.GitDir)