1
from bzrlib.tests.blackbox import ExternalBase
2
from unittest import makeSuite
4
class TestBzrTools(ExternalBase):
7
file(filename, 'wb').write('')
9
def test_clean_tree(self):
13
assert os.path.lexists('name~')
14
self.touch('name.pyc')
15
self.runbzr('clean-tree')
16
assert os.path.lexists('name~')
17
assert not os.path.lexists('name')
18
self.runbzr('clean-tree --detritus')
19
assert not os.path.lexists('name~')
20
assert os.path.lexists('name.pyc')
21
self.runbzr('clean-tree --ignored')
22
assert not os.path.lexists('name.pyc')
24
def test_shelve(self):
26
self.runbzr('commit -m uc --unchanged')
27
self.runbzr('shelve -r 1 -m foo', retcode=0)
29
def test_fetch_ghosts(self):
31
self.runbzr('fetch-ghosts .')
35
file('myfile', 'wb').write('hello')
37
self.runbzr('commit -m hello')
38
file('myfile', 'wb').write('goodbye')
39
file('mypatch', 'wb').write(self.runbzr('diff', retcode=1, backtick=1))
41
assert file('myfile', 'rb').read() == 'hello'
42
self.runbzr('patch mypatch')
43
assert file('myfile', 'rb').read() == 'goodbye'
45
def test_branch_history(self):
47
file('myfile', 'wb').write('hello')
49
self.runbzr('commit -m hello')
50
self.runbzr('branch-history')
52
def test_branch_history(self):
54
file('myfile', 'wb').write('hello')
56
self.runbzr('commit -m hello')
57
self.runbzr('graph-ancestry . graph.dot')
58
self.runbzr('branch . my_branch')
59
self.runbzr('graph-ancestry . graph.dot --merge-branch my_branch')
62
return makeSuite(TestBzrTools)