/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

More work on roundtrip push support.

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
from dulwich.repo import Repo as GitRepo
 
20
 
 
21
from bzrlib import (
 
22
    bzrdir,
 
23
    errors,
 
24
    )
 
25
from bzrlib.tests import TestSkipped
 
26
 
 
27
from bzrlib.plugins.git import (
 
28
    dir,
 
29
    tests,
 
30
    workingtree,
 
31
    )
22
32
 
23
33
 
24
34
class TestGitDir(tests.TestCaseInTempDir):
25
35
 
26
 
    _test_needs_features = [tests.GitCommandFeature]
27
 
 
28
36
    def test_open_existing(self):
29
 
        tests.run_git('init')
 
37
        GitRepo.init(".")
30
38
 
31
39
        gd = bzrdir.BzrDir.open('.')
32
40
        self.assertIsInstance(gd, dir.LocalGitDir)
33
41
 
34
42
    def test_open_workingtree(self):
35
 
        tests.run_git('init')
 
43
        GitRepo.init(".")
36
44
 
37
45
        gd = bzrdir.BzrDir.open('.')
 
46
        raise TestSkipped
38
47
        wt = gd.open_workingtree()
39
48
        self.assertIsInstance(wt, workingtree.GitWorkingTree)
40
49
 
41
50
    def test_open_workingtree_bare(self):
42
 
        tests.run_git('--bare', 'init')
 
51
        GitRepo.init_bare(".")
43
52
 
44
53
        gd = bzrdir.BzrDir.open('.')
45
54
        self.assertRaises(errors.NoWorkingTree, gd.open_workingtree)
46
55
 
47
56
 
48
 
class TestGitDirFormat(tests.TestCaseInTempDir):
49
 
 
50
 
    _test_needs_features = [tests.GitCommandFeature]
 
57
class TestGitDirFormat(tests.TestCase):
51
58
 
52
59
    def setUp(self):
53
60
        super(TestGitDirFormat, self).setUp()
54
 
        self.format = dir.LocalGitBzrDirFormat()
 
61
        self.format = dir.LocalGitControlDirFormat()
55
62
 
56
63
    def test_get_format_description(self):
57
64
        self.assertEquals("Local Git Repository",
58
65
                          self.format.get_format_description())
59
66
 
 
67
    def test_eq(self):
 
68
        format2 = dir.LocalGitControlDirFormat()
 
69
        self.assertEquals(self.format, format2)
 
70
        self.assertEquals(self.format, self.format)
 
71
        bzr_format = bzrdir.format_registry.make_bzrdir("default")
 
72
        self.assertNotEquals(self.format, bzr_format)
 
73