27
28
class TestGitBlackBox(ExternalBase):
30
def simple_commit(self):
31
# Create a git repository with a revision.
33
builder = tests.GitBranchBuilder()
34
builder.set_file('a', 'text for a\n', False)
35
builder.commit('Joe Foo <joe@foo.com>', u'<The commit message>')
29
38
def test_info(self):
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
40
output, error = self.run_bzr(['info'])
38
41
self.assertEqual(error, '')
39
42
self.assertTrue("Repository branch (format: git)" in output)
46
output, error = self.run_bzr(['ls'])
47
self.assertEqual(error, '')
48
self.assertEqual(output, "a\n")
50
def test_info_verbose(self):
53
output, error = self.run_bzr(['info', '-v'])
54
self.assertEqual(error, '')
55
self.assertTrue("Repository branch (format: git)" in output)
56
self.assertTrue("control: Local Git Repository" in output)
57
self.assertTrue("branch: Git Branch" in output)
58
self.assertTrue("repository: Git Repository" in output)
41
60
def test_log(self):
42
61
# 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
64
# Check that bzr log does not fail and includes the revision.
52
65
output, error = self.run_bzr(['log'])
55
68
'<The commit message>' in output,
56
69
"Commit message was not found in output:\n%s" % (output,))
71
def test_log_verbose(self):
72
# Smoke test for "bzr log -v" in a git repository.
75
# Check that bzr log does not fail and includes the revision.
76
output, error = self.run_bzr(['log', '-v'])
81
tests.run_git("tag", "foo")
83
output, error = self.run_bzr(['tags'])
84
self.assertEquals(error, '')
85
self.assertEquals(output, "foo 1\n")
88
raise KnownFailure("setting tags not supported by git-python yet")
91
output, error = self.run_bzr(["tag", "bar"])
93
self.assertEquals(error, '')
94
self.assertEquals(output, '')