~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to tests/blackbox.py

  • Committer: Aaron Bentley
  • Date: 2006-07-11 18:56:01 UTC
  • Revision ID: abentley@panoramicfeedback.com-20060711185601-6e7f164148ed616d
Remove <BZRTOOLS> tag from command descriptions

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
        self.runbzr('clean-tree')
18
18
        assert os.path.lexists('name~')
19
19
        assert not os.path.lexists('name')
20
 
        self.touch('name')
21
20
        self.runbzr('clean-tree --detritus')
22
 
        assert os.path.lexists('name')
23
21
        assert not os.path.lexists('name~')
24
22
        assert os.path.lexists('name.pyc')
25
23
        self.runbzr('clean-tree --ignored')
26
 
        assert os.path.lexists('name')
27
 
        assert not os.path.lexists('name.pyc')
28
 
        self.runbzr('clean-tree --unknown')
29
 
        assert not os.path.lexists('name')
30
 
        self.touch('name')
31
 
        self.touch('name~')
32
 
        self.touch('name.pyc')
33
 
        self.runbzr('clean-tree --unknown --ignored')
34
 
        assert not os.path.lexists('name')
35
 
        assert not os.path.lexists('name~')
36
24
        assert not os.path.lexists('name.pyc')
37
25
 
38
26
    def test_shelve(self):
57
45
        file('mypatch', 'wb').write(self.runbzr('diff', retcode=1, backtick=1))
58
46
        self.runbzr('revert')
59
47
        assert file('myfile', 'rb').read() == 'hello'
60
 
        self.runbzr('patch --silent mypatch')
 
48
        self.runbzr('patch mypatch')
61
49
        assert file('myfile', 'rb').read() == 'goodbye'
62
50
 
63
51
    def test_branch_history(self):
128
116
        self.runbzr('commit -m hello')
129
117
        self.runbzr('export ../source-0.1.tar.gz')
130
118
        self.runbzr('export ../source-0.1.tar.bz2')
131
 
        self.runbzr('export ../source-0.1')
132
119
        self.runbzr('init ../import')
133
120
        os.chdir('../import')
134
121
        self.runbzr('import ../source-0.1.tar.gz')
145
132
        self.failUnlessExists('import3/src/myfile')
146
133
        self.runbzr('import source-0.1.tar.bz2 import4')
147
134
        self.failUnlessExists('import4/src/myfile')
148
 
        self.runbzr('import source-0.1 import5')
149
 
        self.failUnlessExists('import5/src/myfile')
 
135
 
 
136
    def test_shove(self):
 
137
        self.runbzr('init source')
 
138
        f = file('source/file', 'wb')
 
139
        f.write('hello\n')
 
140
        f.close()
 
141
        self.runbzr('add source/file')
 
142
        self.runbzr('commit source -m foo')
 
143
        self.runbzr('branch source target1')
 
144
        self.runbzr('branch source target2')
 
145
        f = file('source/file', 'wb')
 
146
        f.write('goodbye\n')
 
147
        f.close()
 
148
        self.runbzr('shove target1 source')
 
149
        f = file('target1/file', 'rb')
 
150
        self.assertEqual(f.read(), 'goodbye\n')
 
151
        f.close()
 
152
        os.chdir('source')
 
153
        self.runbzr('shove target2', retcode=3)
 
154
        self.runbzr('shove ../target2')
 
155
        f = file('../target2/file', 'rb')
 
156
        self.assertEqual(f.read(), 'goodbye\n')
 
157
        f.close()
150
158
 
151
159
def test_suite():
152
160
    return makeSuite(TestBzrTools)