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

More refactoring. Add some direct tests for GitModel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
from bzrlib import repository
22
22
 
23
23
from bzrlib.plugins.git import tests
24
 
from bzrlib.plugins.git.gitlib import git_repository
 
24
from bzrlib.plugins.git.gitlib import (
 
25
    git_repository,
 
26
    model,
 
27
    )
25
28
 
26
29
 
27
30
class TestGitRepository(tests.TestCaseInTempDir):
29
32
    _test_needs_features = [tests.GitCommandFeature]
30
33
 
31
34
    def test_open_existing(self):
32
 
        p = subprocess.Popen(['git', 'init'],
33
 
                             stdout=subprocess.PIPE,
34
 
                             stderr=subprocess.PIPE)
35
 
        p.communicate()
36
 
 
37
 
        gd = repository.Repository.open('.')
38
 
        self.assertIsInstance(gd, git_repository.GitRepository)
 
35
        tests.run_git('init')
 
36
 
 
37
        repo = repository.Repository.open('.')
 
38
        self.assertIsInstance(repo, git_repository.GitRepository)
 
39
 
 
40
    def test_has_git_model(self):
 
41
        tests.run_git('init')
 
42
 
 
43
        repo = repository.Repository.open('.')
 
44
        self.assertIsInstance(repo._git, model.GitModel)