~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/workingtree_implementations/test_workingtree.py

  • Committer: Marius Kruger
  • Date: 2007-01-03 06:14:43 UTC
  • mfrom: (2206.1.10 bzr.enhanced_move)
  • mto: This revision was merged to the branch mainline in revision 2241.
  • Revision ID: amanic@gmail.com-20070103061443-i6kogbeqb54148p9
merge enhancedmv3.patch with bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
681
681
                tree.add, [u'a\u030a'])
682
682
        finally:
683
683
            osutils.normalized_filename = orig
 
684
 
 
685
    def test_move_deprecated_correct_call_named(self):
 
686
        """tree.move has the deprecated parameter 'to_name'.
 
687
        It has been replaced by 'to_dir' for consistency.
 
688
        Test the new API using named parameter"""
 
689
        self.build_tree(['a1', 'sub1/'])
 
690
        tree = self.make_branch_and_tree('.')
 
691
        tree.add(['a1', 'sub1'])
 
692
        tree.commit('initial commit')
 
693
        tree.move(['a1'], to_dir='sub1', after=False)
 
694
        
 
695
    def test_move_deprecated_correct_call_unnamed(self):
 
696
        """tree.move has the deprecated parameter 'to_name'.
 
697
        It has been replaced by 'to_dir' for consistency.
 
698
        Test the new API using unnamed parameter"""
 
699
        self.build_tree(['a1', 'sub1/'])
 
700
        tree = self.make_branch_and_tree('.')
 
701
        tree.add(['a1', 'sub1'])
 
702
        tree.commit('initial commit')
 
703
        tree.move(['a1'], 'sub1', after=False)
 
704
        
 
705
    def test_move_deprecated_wrong_call(self):
 
706
        """tree.move has the deprecated parameter 'to_name'.
 
707
        It has been replaced by 'to_dir' for consistency.
 
708
        Test the new API using wrong parameter"""
 
709
        self.build_tree(['a1', 'sub1/'])
 
710
        tree = self.make_branch_and_tree('.')
 
711
        tree.add(['a1', 'sub1'])
 
712
        tree.commit('initial commit')
 
713
        self.assertRaises(TypeError, tree.move, ['a1'], 
 
714
                          to_this_parameter_does_not_exist='sub1',
 
715
                          after=False)
 
716
 
 
717
    def test_move_deprecated_deprecated_call(self):
 
718
        """tree.move has the deprecated parameter 'to_name'.
 
719
        It has been replaced by 'to_dir' for consistency.
 
720
        Test the new API using deprecated parameter"""
 
721
        self.build_tree(['a1', 'sub1/'])
 
722
        tree = self.make_branch_and_tree('.')
 
723
        tree.add(['a1', 'sub1'])
 
724
        tree.commit('initial commit')
 
725
 
 
726
        #tree.move(['a1'], to_name='sub1', after=False)
 
727
        self.callDeprecated(['The parameter to_name was deprecated'
 
728
                             ' in version 0.13. Use to_dir instead'],
 
729
                            tree.move, ['a1'], to_name='sub1',
 
730
                            after=False)