/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

Add FOSDEM roundtripping notes.

Show diffs side-by-side

added added

removed removed

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