~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/blackbox.py

  • Committer: Robert Collins
  • Date: 2005-08-24 08:34:10 UTC
  • mto: (974.1.50) (1185.1.10) (1092.3.1)
  • mto: This revision was merged to the branch mainline in revision 1139.
  • Revision ID: robertc@robertcollins.net-20050824083410-98aa4eeb52653394
import and use TestUtil to do regex based partial test runs

Show diffs side-by-side

added added

removed removed

Lines of Context:
178
178
        self.log(tmp_output)
179
179
        self.assertEquals(output, tmp_output)
180
180
 
181
 
    def example_branch(test):
182
 
        test.runbzr('init')
183
 
        file('hello', 'wt').write('foo')
184
 
        test.runbzr('add hello')
185
 
        test.runbzr('commit -m setup hello')
186
 
        file('goodbye', 'wt').write('baz')
187
 
        test.runbzr('add goodbye')
188
 
        test.runbzr('commit -m setup goodbye')
189
 
 
190
 
    def test_revert(self):
191
 
        self.example_branch()
192
 
        file('hello', 'wt').write('bar')
193
 
        file('goodbye', 'wt').write('qux')
194
 
        self.runbzr('revert hello')
195
 
        self.check_file_contents('hello', 'foo')
196
 
        self.check_file_contents('goodbye', 'qux')
197
 
        self.runbzr('revert')
198
 
        self.check_file_contents('goodbye', 'baz')
199
 
 
200
 
    def test_merge(self):
201
 
        from bzrlib.branch import Branch
202
 
        import os
203
 
        os.mkdir('a')
204
 
        os.chdir('a')
205
 
        self.example_branch()
206
 
        os.chdir('..')
207
 
        self.runbzr('branch a b')
208
 
        os.chdir('b')
209
 
        file('goodbye', 'wt').write('quux')
210
 
        self.runbzr(['commit',  '-m',  "more u's are always good"])
211
 
 
212
 
        os.chdir('../a')
213
 
        file('hello', 'wt').write('quuux')
214
 
        # We can't merge when there are in-tree changes
215
 
        self.runbzr('merge ../b', retcode=1)
216
 
        self.runbzr(['commit', '-m', "Like an epidemic of u's"])
217
 
        self.runbzr('merge ../b')
218
 
        self.check_file_contents('goodbye', 'quux')
219
 
        # Merging a branch pulls its revision into the tree
220
 
        a = Branch('.')
221
 
        b = Branch('../b')
222
 
        a.get_revision_xml(b.last_patch())
223
 
        print "Pending: %s" % a.pending_merges()
224
 
#        assert a.pending_merges() == [b.last_patch()], "Assertion %s %s" \
225
 
#        % (a.pending_merges(), b.last_patch())
226
 
 
227
181
class OldTests(ExternalBase):
228
 
    """old tests moved from ./testbzr."""
229
 
 
 
182
    # old tests moved from ./testbzr
230
183
    def test_bzr(self):
231
184
        from os import chdir, mkdir
232
185
        from os.path import exists
394
347
        runbzr('log --forward')
395
348
 
396
349
        runbzr('info')
397