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

More refactoring. Add some direct tests for GitModel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
 
17
"""The basic test suite for bzr-git."""
 
18
 
 
19
import subprocess
 
20
 
17
21
from bzrlib import (
18
22
    tests,
19
23
    trace,
27
31
class _GitCommandFeature(tests.Feature):
28
32
 
29
33
    def _probe(self):
30
 
        import subprocess
31
34
        try:
32
35
            p = subprocess.Popen(['git', '--version'], stdout=subprocess.PIPE)
33
36
        except IOError:
42
45
GitCommandFeature = _GitCommandFeature()
43
46
 
44
47
 
 
48
def run_git(*args):
 
49
    cmd = ['git'] + list(args)
 
50
    p = subprocess.Popen(cmd,
 
51
                         stdout=subprocess.PIPE,
 
52
                         stderr=subprocess.PIPE)
 
53
    out, err = p.communicate()
 
54
    if p.returncode != 0:
 
55
        raise AssertionError('Bad return code: %d for %s:\n%s'
 
56
                             % (p.returncode, ' '.join(cmd), err))
 
57
    return out
 
58
 
 
59
 
45
60
def test_suite():
46
61
    loader = tests.TestLoader()
47
62
 
51
66
        'test_git_branch',
52
67
        'test_git_dir',
53
68
        'test_git_repository',
 
69
        'test_model',
54
70
        'test_ids',
55
71
        ]
56
72
    testmod_names = ['%s.%s' % (__name__, t) for t in testmod_names]