~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to tests/blackbox.py

  • Committer: Aaron Bentley
  • Date: 2006-07-13 13:25:20 UTC
  • Revision ID: abentley@panoramicfeedback.com-20060713132520-2fabfab51affb82f
Update clean-tree docs

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
        file('mypatch', 'wb').write(self.runbzr('diff', retcode=1, backtick=1))
58
58
        self.runbzr('revert')
59
59
        assert file('myfile', 'rb').read() == 'hello'
60
 
        self.runbzr('patch --silent mypatch')
 
60
        self.runbzr('patch mypatch')
61
61
        assert file('myfile', 'rb').read() == 'goodbye'
62
62
 
63
63
    def test_branch_history(self):
128
128
        self.runbzr('commit -m hello')
129
129
        self.runbzr('export ../source-0.1.tar.gz')
130
130
        self.runbzr('export ../source-0.1.tar.bz2')
131
 
        self.runbzr('export ../source-0.1')
132
131
        self.runbzr('init ../import')
133
132
        os.chdir('../import')
134
133
        self.runbzr('import ../source-0.1.tar.gz')
145
144
        self.failUnlessExists('import3/src/myfile')
146
145
        self.runbzr('import source-0.1.tar.bz2 import4')
147
146
        self.failUnlessExists('import4/src/myfile')
148
 
        self.runbzr('import source-0.1 import5')
149
 
        self.failUnlessExists('import5/src/myfile')
 
147
 
 
148
    def test_shove(self):
 
149
        self.runbzr('init source')
 
150
        f = file('source/file', 'wb')
 
151
        f.write('hello\n')
 
152
        f.close()
 
153
        self.runbzr('add source/file')
 
154
        self.runbzr('commit source -m foo')
 
155
        self.runbzr('branch source target1')
 
156
        self.runbzr('branch source target2')
 
157
        f = file('source/file', 'wb')
 
158
        f.write('goodbye\n')
 
159
        f.close()
 
160
        self.runbzr('shove target1 source')
 
161
        f = file('target1/file', 'rb')
 
162
        self.assertEqual(f.read(), 'goodbye\n')
 
163
        f.close()
 
164
        os.chdir('source')
 
165
        self.runbzr('shove target2', retcode=3)
 
166
        self.runbzr('shove ../target2')
 
167
        f = file('../target2/file', 'rb')
 
168
        self.assertEqual(f.read(), 'goodbye\n')
 
169
        f.close()
150
170
 
151
171
def test_suite():
152
172
    return makeSuite(TestBzrTools)