~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_workingtree/test_move.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-07-16 09:26:03 UTC
  • mfrom: (5346.1.7 deprecations)
  • Revision ID: pqm@pqm.ubuntu.com-20100716092603-gi09i1u5bp2gb68i
(vila) Delete deprecated code. (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
            tree.move(['a1'], 'sub1', after=False))
80
80
        tree._validate()
81
81
 
82
 
    def test_move_deprecated_wrong_call(self):
83
 
        """tree.move has the deprecated parameter 'to_name'.
84
 
        It has been replaced by 'to_dir' for consistency.
85
 
        Test the new API using wrong parameter
86
 
        """
87
 
        self.build_tree(['a1', 'sub1/'])
88
 
        tree = self.make_branch_and_tree('.')
89
 
        tree.add(['a1', 'sub1'])
90
 
        tree.commit('initial commit')
91
 
        self.assertRaises(TypeError, tree.move, ['a1'],
92
 
                          to_this_parameter_does_not_exist='sub1',
93
 
                          after=False)
94
 
        tree._validate()
95
 
 
96
 
    def test_move_deprecated_call(self):
97
 
        """tree.move has the deprecated parameter 'to_name'.
98
 
        It has been replaced by 'to_dir' for consistency.
99
 
        Test the new API using deprecated parameter
100
 
        """
101
 
        self.build_tree(['a1', 'sub1/'])
102
 
        tree = self.make_branch_and_tree('.')
103
 
        tree.add(['a1', 'sub1'])
104
 
        tree.commit('initial commit')
105
 
 
106
 
        try:
107
 
            self.callDeprecated(['The parameter to_name was deprecated'
108
 
                                 ' in version 0.13. Use to_dir instead'],
109
 
                                tree.move, ['a1'], to_name='sub1',
110
 
                                after=False)
111
 
        except TypeError:
112
 
            # WorkingTreeFormat4 and later don't have to maintain api
113
 
            # compatibility since it was deprecated before they were introduced.
114
 
            if not isinstance(self.workingtree_format,
115
 
                DirStateWorkingTreeFormat):
116
 
                raise
117
 
        tree._validate()
118
 
 
119
82
    def test_move_target_not_dir(self):
120
83
        tree = self.make_branch_and_tree('.')
121
84
        self.build_tree(['a'])