~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/blackbox.py

  • Committer: Aaron Bentley
  • Date: 2005-09-11 22:10:44 UTC
  • mto: (1185.3.4)
  • mto: This revision was merged to the branch mainline in revision 1390.
  • Revision ID: aaron.bentley@utoronto.ca-20050911221044-031b2705516b23de
Added test for pull

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
"""
28
28
 
29
29
import sys
 
30
import os
30
31
 
31
32
from bzrlib.selftest import TestCaseInTempDir, BzrTestBase
32
33
from bzrlib.branch import Branch
122
123
        assert file('.bzrignore', 'rb').read() == '*.blah\ngarh\n'
123
124
 
124
125
    def test_revert(self):
125
 
        import os
126
126
        self.runbzr('init')
127
127
 
128
128
        file('hello', 'wt').write('foo')
194
194
 
195
195
    def test_merge(self):
196
196
        from bzrlib.branch import Branch
197
 
        import os
198
197
        
199
198
        os.mkdir('a')
200
199
        os.chdir('a')
222
221
        #        assert a.pending_merges() == [b.last_patch()], "Assertion %s %s" \
223
222
        #        % (a.pending_merges(), b.last_patch())
224
223
 
 
224
    def test_pull(self):
 
225
        """Pull changes from one branch to another."""
 
226
        os.mkdir('a')
 
227
        os.chdir('a')
 
228
 
 
229
        self.example_branch()
 
230
        os.chdir('..')
 
231
        self.runbzr('branch a b')
 
232
        os.chdir('b')
 
233
        self.runbzr('commit -m blah --unchanged')
 
234
        os.chdir('../a')
 
235
        a = Branch('.')
 
236
        b = Branch('../b')
 
237
        assert a.revision_history() == b.revision_history()[:-1]
 
238
        self.runbzr('pull ../b')
 
239
        assert a.revision_history() == b.revision_history()
 
240
        self.runbzr('commit -m blah2 --unchanged')
 
241
        os.chdir('../b')
 
242
        self.runbzr('commit -m blah3 --unchanged')
 
243
        self.runbzr('pull ../a', retcode=1)
225
244
 
226
245
    def test_add_reports(self):
227
246
        """add command prints the names of added files."""
250
269
    def test_bzr(self):
251
270
        from os import chdir, mkdir
252
271
        from os.path import exists
253
 
        import os
254
272
 
255
273
        runbzr = self.runbzr
256
274
        backtick = self.backtick