/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
29
    def test_log(self):
30
        # Smoke test for "bzr log" in a git repository.
31
32
        # Create a git repository with a revision.
33
        tests.run_git('init')
34
        builder = tests.GitBranchBuilder()
35
        builder.set_file('a', 'text for a\n', False)
36
        builder.commit('Joe Foo <joe@foo.com>', u'<The commit message>')
37
        builder.finish()
38
39
        # Check that bzr log does not fail and includes the revision.
40
        output, error = self.run_bzr(['log'])
41
        self.assertEqual(error, '')
42
        self.assertTrue(
43
            '<The commit message>' in output,
44
            "Commit message was not found in output:\n%s" % (output,))