/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_shelf_ui.py

  • Committer: Vincent Ladeuil
  • Date: 2011-07-06 09:22:00 UTC
  • mfrom: (6008 +trunk)
  • mto: (6012.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 6013.
  • Revision ID: v.ladeuil+lp@free.fr-20110706092200-7iai2mwzc0sqdsvf
MergingĀ inĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
LINES_AY = 'a\nb\nc\nd\ne\nf\ng\nh\ni\ny\n'
64
64
 
65
65
 
66
 
class TestShelver(tests.TestCaseWithTransport):
 
66
class ShelfTestCase(tests.TestCaseWithTransport):
67
67
 
68
68
    def create_shelvable_tree(self):
69
69
        tree = self.make_branch_and_tree('tree')
73
73
        self.build_tree_contents([('tree/foo', LINES_ZY)])
74
74
        return tree
75
75
 
 
76
 
 
77
class TestShelver(ShelfTestCase):
 
78
 
76
79
    def test_unexpected_prompt_failure(self):
77
80
        tree = self.create_shelvable_tree()
78
81
        tree.lock_tree_write()
308
311
                                from_revision=revision.NULL_REVISION)
309
312
        tree1.commit('Replaced root entry')
310
313
        # This is essentially assertNotRaises(InconsistentDelta)
311
 
        self.expectFailure('Cannot shelve replacing a root entry',
312
 
                           self.assertRaises, AssertionError,
313
 
                           self.assertRaises, errors.InconsistentDelta,
314
 
                           self.shelve_all, tree1, rev2)
 
314
        # With testtools 0.99, it can be rewritten as:
 
315
        # with ExpectedException(AssertionError,
 
316
        #                        'InconsistentDelta not raised'):
 
317
        #     with ExpectedException(errors.InconsistentDelta, ''):
 
318
        #         self.shelve_all(tree1, rev2)
 
319
        e = self.assertRaises(AssertionError, self.assertRaises,
 
320
                              errors.InconsistentDelta, self.shelve_all, tree1,
 
321
                              rev2)
 
322
        self.assertContainsRe('InconsistentDelta not raised', str(e))
315
323
 
316
324
    def test_shelve_split(self):
317
325
        outer_tree = self.make_branch_and_tree('outer')
327
335
                           outer_tree, rev2)
328
336
 
329
337
 
330
 
class TestApplyReporter(TestShelver):
 
338
class TestApplyReporter(ShelfTestCase):
331
339
 
332
340
    def test_shelve_not_diff(self):
333
341
        tree = self.create_shelvable_tree()