/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
0.200.39 by David Allouche
Black-box text for "bzr log" in a git tree. Further simplification of GitRevisionTree.
1
# Copyright (C) 2007 David Allouche <ddaa@ddaa.net>
2
#
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 2 of the License, or
6
# (at your option) any later version.
7
#
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
# GNU General Public License for more details.
12
#
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
17
"""Black-box tests for bzr-git."""
18
19
from bzrlib.tests.blackbox import ExternalBase
20
21
from bzrlib.plugins.git import (
22
    ids,
23
    tests,
24
    )
25
26
27
class TestGitBlackBox(ExternalBase):
28
0.200.76 by Jelmer Vernooij
Add blackbox test for info -v
29
    def simple_commit(self):
30
        # Create a git repository with a revision.
31
        tests.run_git('init')
32
        builder = tests.GitBranchBuilder()
33
        builder.set_file('a', 'text for a\n', False)
34
        builder.commit('Joe Foo <joe@foo.com>', u'<The commit message>')
35
        builder.finish()
36
37
0.200.68 by Jelmer Vernooij
Add blackbox test for info.
38
    def test_info(self):
0.200.76 by Jelmer Vernooij
Add blackbox test for info -v
39
        self.simple_commit()
0.200.68 by Jelmer Vernooij
Add blackbox test for info.
40
        output, error = self.run_bzr(['info'])
41
        self.assertEqual(error, '')
42
        self.assertTrue("Repository branch (format: git)" in output)
43
0.200.76 by Jelmer Vernooij
Add blackbox test for info -v
44
    def test_info_verbose(self):
45
        self.simple_commit()
46
47
        output, error = self.run_bzr(['info', '-v'])
48
        self.assertEqual(error, '')
49
        self.assertTrue("Repository branch (format: git)" in output)
50
        self.assertTrue("control: Local Git Repository" in output)
51
        self.assertTrue("branch: Git Branch" in output)
52
        self.assertTrue("repository: Git Repository" in output)
53
0.200.39 by David Allouche
Black-box text for "bzr log" in a git tree. Further simplification of GitRevisionTree.
54
    def test_log(self):
55
        # Smoke test for "bzr log" in a git repository.
56
0.200.76 by Jelmer Vernooij
Add blackbox test for info -v
57
        self.simple_commit()
0.200.39 by David Allouche
Black-box text for "bzr log" in a git tree. Further simplification of GitRevisionTree.
58
59
        # Check that bzr log does not fail and includes the revision.
60
        output, error = self.run_bzr(['log'])
61
        self.assertEqual(error, '')
62
        self.assertTrue(
63
            '<The commit message>' in output,
64
            "Commit message was not found in output:\n%s" % (output,))