1
# Copyright (C) 2007 David Allouche <ddaa@ddaa.net>
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.
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.
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
17
"""Black-box tests for bzr-git."""
19
from bzrlib.tests.blackbox import ExternalBase
21
from bzrlib.plugins.git import (
27
class TestGitBlackBox(ExternalBase):
30
# Create a git repository with a revision.
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>')
37
output, error = self.run_bzr(['info'])
38
self.assertEqual(error, '')
39
self.assertTrue("Repository branch (format: git)" in output)
42
# Smoke test for "bzr log" in a git repository.
44
# Create a git repository with a revision.
46
builder = tests.GitBranchBuilder()
47
builder.set_file('a', 'text for a\n', False)
48
builder.commit('Joe Foo <joe@foo.com>', u'<The commit message>')
51
# Check that bzr log does not fail and includes the revision.
52
output, error = self.run_bzr(['log'])
53
self.assertEqual(error, '')
55
'<The commit message>' in output,
56
"Commit message was not found in output:\n%s" % (output,))