1
"""Black-box tests for bzr missing.
6
from bzrlib.branch import Branch
7
from bzrlib.tests import TestCaseInTempDir
9
class TestMissing(TestCaseInTempDir):
10
def test_missing(self):
11
missing = "You are missing the following revisions:"
13
# create a source branch
17
open('a', 'wb').write('initial\n')
19
self.capture('commit -m inital')
21
# clone and add a differing revision
22
self.capture('branch . ../b')
24
open('a', 'ab').write('more\n')
25
self.capture('commit -m more')
29
lines = self.capture('missing ../b').splitlines()
30
# we're missing the extra revision here
31
self.assertEqual(missing, lines[0])
32
self.assertEqual(8, len(lines))
34
# get extra revision from b
35
self.capture('merge ../b')
36
self.capture('commit -m merge')
38
# compare again, but now we have the 'merge' commit extra
39
lines = self.capture('missing ../b').splitlines()
40
self.assertEqual("You have the following extra revisions:", lines[0])
41
self.assertEqual(8, len(lines))
43
# relative to a, missing the 'merge' commit
45
lines = self.capture('missing ../a').splitlines()
46
self.assertEqual(missing, lines[0])
47
self.assertEqual(8, len(lines))
49
# after a pull we're back on track
51
self.assertEqual("Branches are up to date.\n", self.capture('missing ../a'))