~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_shelf.py

  • Committer: Martin Pool
  • Date: 2011-04-15 07:01:22 UTC
  • mto: This revision was merged to the branch mainline in revision 5789.
  • Revision ID: mbp@sourcefrog.net-20110415070122-7x24skeadcm7wvut
Switch away from using failUnlessExists and failIfExists

Show diffs side-by-side

added added

removed removed

Lines of Context:
191
191
        s_trans_id = creator.shelf_transform.trans_id_file_id('foo-id')
192
192
        self.assertEqual('foo-id',
193
193
                         creator.shelf_transform.final_file_id(s_trans_id))
194
 
        self.failIfExists('foo')
195
 
        self.failIfExists('bar')
 
194
        self.assertPathDoesNotExist('foo')
 
195
        self.assertPathDoesNotExist('bar')
196
196
        self.assertShelvedFileEqual('a\n', creator, 'foo-id')
197
197
        s_bar_trans_id = creator.shelf_transform.trans_id_file_id('bar-id')
198
198
        self.assertEqual('directory',
231
231
            creator.shelve_creation('foo-id')
232
232
        creator.transform()
233
233
        s_trans_id = creator.shelf_transform.trans_id_file_id('foo-id')
234
 
        self.failIfExists(link_name)
 
234
        self.assertPathDoesNotExist(link_name)
235
235
        limbo_name = creator.shelf_transform._limbo_name(s_trans_id)
236
236
        self.assertEqual(link_target, osutils.readlink(limbo_name))
237
237
        ptree = creator.shelf_transform.get_preview_tree()
310
310
        s_trans_id = creator.shelf_transform.trans_id_file_id('foo-id')
311
311
        self.assertEqual('foo-id',
312
312
                         creator.shelf_transform.final_file_id(s_trans_id))
313
 
        self.failIfExists('foo')
 
313
        self.assertPathDoesNotExist('foo')
314
314
 
315
315
    def prepare_shelve_deletion(self):
316
316
        tree = self.make_branch_and_tree('tree')
362
362
                         sorted(list(creator.iter_shelvable())))
363
363
        creator.shelve_deletion('foo-id')
364
364
        creator.transform()
365
 
        self.failUnlessExists('tree/foo')
 
365
        self.assertPathExists('tree/foo')
366
366
 
367
367
    def prepare_shelve_change_kind(self):
368
368
        tree = self.make_branch_and_tree('tree')
421
421
                         sorted(list(creator.iter_shelvable())))
422
422
        creator.shelve_deletion('foo-id')
423
423
        creator.transform()
424
 
        self.failUnlessExists('tree/foo')
 
424
        self.assertPathExists('tree/foo')
425
425
 
426
426
    def test_shelve_serialization(self):
427
427
        tree = self.make_branch_and_tree('.')
636
636
            creator.shelve_change(change)
637
637
        shelf_manager = tree.get_shelf_manager()
638
638
        shelf_id = shelf_manager.shelve_changes(creator)
639
 
        self.failIfExists('dir/subdir')
 
639
        self.assertPathDoesNotExist('dir/subdir')
640
640
        tree.remove(['dir'])
641
641
        unshelver = shelf_manager.get_unshelver(shelf_id)
642
642
        self.addCleanup(unshelver.finalize)
643
643
        unshelver.make_merger().do_merge()
644
 
        self.failUnlessExists('dir/subdir/foo')
 
644
        self.assertPathExists('dir/subdir/foo')
645
645
        self.assertEqual('dir-id', tree.path2id('dir'))
646
646
        self.assertEqual('subdir-id', tree.path2id('dir/subdir'))
647
647
        self.assertEqual('foo-id', tree.path2id('dir/subdir/foo'))
746
746
        creator.shelve_creation('foo-id')
747
747
        shelf_manager = tree.get_shelf_manager()
748
748
        shelf_id = shelf_manager.shelve_changes(creator)
749
 
        self.failIfExists('tree/foo')
 
749
        self.assertPathDoesNotExist('tree/foo')
750
750
        unshelver = shelf_manager.get_unshelver(shelf_id)
751
751
        self.addCleanup(unshelver.finalize)
752
752
        unshelver.make_merger().do_merge()