~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_conflicts.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-04-16 01:09:56 UTC
  • mfrom: (5784.1.4 760435-less-fail)
  • Revision ID: pqm@pqm.ubuntu.com-20110416010956-5wrpm136qq2hz5f3
(mbp) rename and deprecate failUnlessExists and failIfExists (Martin Pool)

Show diffs side-by-side

added added

removed removed

Lines of Context:
446
446
        return [('unversion', 'file-id')]
447
447
 
448
448
    def check_file_doesnt_exist(self):
449
 
        self.failIfExists('branch/file')
 
449
        self.assertPathDoesNotExist('branch/file')
450
450
 
451
451
    def do_create_file_in_dir(self):
452
452
        return [('add', ('dir', 'dir-id', 'directory', '')),
459
459
        self.assertFileEqual('trunk content\nmore content\n', 'branch/dir/file')
460
460
 
461
461
    def check_file_in_dir_doesnt_exist(self):
462
 
        self.failIfExists('branch/dir/file')
 
462
        self.assertPathDoesNotExist('branch/dir/file')
463
463
 
464
464
    def _get_resolve_path_arg(self, wt, action):
465
465
        return self._path
540
540
        return [('rename', ('file', 'new-file'))]
541
541
 
542
542
    def check_file_renamed(self):
543
 
        self.failIfExists('branch/file')
544
 
        self.failUnlessExists('branch/new-file')
 
543
        self.assertPathDoesNotExist('branch/file')
 
544
        self.assertPathExists('branch/new-file')
545
545
 
546
546
    def do_rename_file2(self):
547
547
        return [('rename', ('file', 'new-file2'))]
548
548
 
549
549
    def check_file_renamed2(self):
550
 
        self.failIfExists('branch/file')
551
 
        self.failUnlessExists('branch/new-file2')
 
550
        self.assertPathDoesNotExist('branch/file')
 
551
        self.assertPathExists('branch/new-file2')
552
552
 
553
553
    def do_rename_dir(self):
554
554
        return [('rename', ('dir', 'new-dir'))]
555
555
 
556
556
    def check_dir_renamed(self):
557
 
        self.failIfExists('branch/dir')
558
 
        self.failUnlessExists('branch/new-dir')
 
557
        self.assertPathDoesNotExist('branch/dir')
 
558
        self.assertPathExists('branch/new-dir')
559
559
 
560
560
    def do_rename_dir2(self):
561
561
        return [('rename', ('dir', 'new-dir2'))]
562
562
 
563
563
    def check_dir_renamed2(self):
564
 
        self.failIfExists('branch/dir')
565
 
        self.failUnlessExists('branch/new-dir2')
 
564
        self.assertPathDoesNotExist('branch/dir')
 
565
        self.assertPathExists('branch/new-dir2')
566
566
 
567
567
    def do_delete_file(self):
568
568
        return [('unversion', 'file-id')]
569
569
 
570
570
    def check_file_doesnt_exist(self):
571
 
        self.failIfExists('branch/file')
 
571
        self.assertPathDoesNotExist('branch/file')
572
572
 
573
573
    def do_delete_dir(self):
574
574
        return [('unversion', 'dir-id')]
575
575
 
576
576
    def check_dir_doesnt_exist(self):
577
 
        self.failIfExists('branch/dir')
 
577
        self.assertPathDoesNotExist('branch/dir')
578
578
 
579
579
    def do_create_file_in_dir(self):
580
580
        return [('add', ('dir', 'dir-id', 'directory', '')),
584
584
        return [('rename', ('dir/file', 'dir/new-file'))]
585
585
 
586
586
    def check_file_in_dir_renamed(self):
587
 
        self.failIfExists('branch/dir/file')
588
 
        self.failUnlessExists('branch/dir/new-file')
 
587
        self.assertPathDoesNotExist('branch/dir/file')
 
588
        self.assertPathExists('branch/dir/new-file')
589
589
 
590
590
    def check_file_in_dir_doesnt_exist(self):
591
 
        self.failIfExists('branch/dir/file')
 
591
        self.assertPathDoesNotExist('branch/dir/file')
592
592
 
593
593
    def _get_resolve_path_arg(self, wt, action):
594
594
        tpath = self._this['path']
885
885
        return [('rename', ('dir1', 'dir2/dir1'))]
886
886
 
887
887
    def check_dir1_moved(self):
888
 
        self.failIfExists('branch/dir1')
889
 
        self.failUnlessExists('branch/dir2/dir1')
 
888
        self.assertPathDoesNotExist('branch/dir1')
 
889
        self.assertPathExists('branch/dir2/dir1')
890
890
 
891
891
    def do_move_dir2_into_dir1(self):
892
892
        return [('rename', ('dir2', 'dir1/dir2'))]
893
893
 
894
894
    def check_dir2_moved(self):
895
 
        self.failIfExists('branch/dir2')
896
 
        self.failUnlessExists('branch/dir1/dir2')
 
895
        self.assertPathDoesNotExist('branch/dir2')
 
896
        self.assertPathExists('branch/dir1/dir2')
897
897
 
898
898
    def do_create_dir1_4(self):
899
899
        return [('add', ('dir1', 'dir1-id', 'directory', '')),
905
905
        return [('rename', ('dir1', 'dir3/dir4/dir1'))]
906
906
 
907
907
    def check_dir1_2_moved(self):
908
 
        self.failIfExists('branch/dir1')
909
 
        self.failUnlessExists('branch/dir3/dir4/dir1')
910
 
        self.failUnlessExists('branch/dir3/dir4/dir1/dir2')
 
908
        self.assertPathDoesNotExist('branch/dir1')
 
909
        self.assertPathExists('branch/dir3/dir4/dir1')
 
910
        self.assertPathExists('branch/dir3/dir4/dir1/dir2')
911
911
 
912
912
    def do_move_dir3_into_dir2(self):
913
913
        return [('rename', ('dir3', 'dir1/dir2/dir3'))]
914
914
 
915
915
    def check_dir3_4_moved(self):
916
 
        self.failIfExists('branch/dir3')
917
 
        self.failUnlessExists('branch/dir1/dir2/dir3')
918
 
        self.failUnlessExists('branch/dir1/dir2/dir3/dir4')
 
916
        self.assertPathDoesNotExist('branch/dir3')
 
917
        self.assertPathExists('branch/dir1/dir2/dir3')
 
918
        self.assertPathExists('branch/dir1/dir2/dir3/dir4')
919
919
 
920
920
    def _get_resolve_path_arg(self, wt, action):
921
921
        # ParentLoop says: moving <conflict_path> into <path>. Cancelled move.