~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_symbol_versioning.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-06-10 10:33:31 UTC
  • mfrom: (4426.1.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090610103331-ht76b0l92gj1gn9d
(bialix) Start Russian translation

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
        expected_warning = (
77
77
            "bzrlib.tests.test_symbol_versioning."
78
78
            "deprecated_static "
79
 
            "was deprecated in version 0.7.0.", DeprecationWarning, 2)
 
79
            "was deprecated in version 0.7.", DeprecationWarning, 2)
80
80
        expected_docstring = (
81
81
            'Deprecated static.\n'
82
82
            '\n'
83
 
            'This function was deprecated in version 0.7.0.\n'
 
83
            'This function was deprecated in version 0.7.\n'
84
84
            )
85
85
        self.check_deprecated_callable(
86
86
            expected_warning, expected_docstring,
92
92
        expected_warning = (
93
93
            "bzrlib.tests.test_symbol_versioning."
94
94
            "TestDeprecationWarnings.deprecated_method "
95
 
            "was deprecated in version 0.7.0.", DeprecationWarning, 2)
96
 
        expected_docstring = (
97
 
            'Deprecated method docstring.\n'
98
 
            '\n'
99
 
            '        This might explain stuff.\n'
100
 
            '        \n'
101
 
            '        This method was deprecated in version 0.7.0.\n'
102
 
            '        ')
 
95
            "was deprecated in version 0.7.", DeprecationWarning, 2)
 
96
        expected_docstring = ('Deprecated method docstring.\n'
 
97
                              '\n'
 
98
                              '        This might explain stuff.\n'
 
99
                              '        \n'
 
100
                              '        This method was deprecated in version 0.7.\n'
 
101
                              '        ')
103
102
        self.check_deprecated_callable(expected_warning, expected_docstring,
104
103
                                       "deprecated_method",
105
104
                                       "bzrlib.tests.test_symbol_versioning",
108
107
    def test_deprecated_function(self):
109
108
        expected_warning = (
110
109
            "bzrlib.tests.test_symbol_versioning.sample_deprecated_function "
111
 
            "was deprecated in version 0.7.0.", DeprecationWarning, 2)
 
110
            "was deprecated in version 0.7.", DeprecationWarning, 2)
112
111
        expected_docstring = ('Deprecated function docstring.\n'
113
112
                              '\n'
114
 
                              'This function was deprecated in version 0.7.0.\n'
 
113
                              'This function was deprecated in version 0.7.\n'
115
114
                              )
116
115
        self.check_deprecated_callable(expected_warning, expected_docstring,
117
116
                                       "sample_deprecated_function",
120
119
 
121
120
    def test_deprecated_list(self):
122
121
        expected_warning = (
123
 
            "Modifying a_deprecated_list was deprecated in version 0.9.0."
 
122
            "Modifying a_deprecated_list was deprecated in version 0.9."
124
123
            " Don't use me", DeprecationWarning, 3)
125
124
        old_warning_method = symbol_versioning.warn
126
125
        try:
158
157
 
159
158
    def test_deprecated_dict(self):
160
159
        expected_warning = (
161
 
            "access to a_deprecated_dict was deprecated in version 0.14.0."
 
160
            "access to a_deprecated_dict was deprecated in version 0.14."
162
161
            " Pull the other one!", DeprecationWarning, 2)
163
162
        old_warning_method = symbol_versioning.warn
164
163
        try:
206
205
        """We can get a deprecation string for a method or function."""
207
206
        self.assertEqual('bzrlib.tests.test_symbol_versioning.'
208
207
            'TestDeprecationWarnings.test_deprecation_string was deprecated in '
209
 
            'version 0.11.0.',
 
208
            'version 0.11.',
210
209
            symbol_versioning.deprecation_string(
211
210
            self.test_deprecation_string,
212
211
            deprecated_in((0, 11, 0))))
213
212
        self.assertEqual('bzrlib.symbol_versioning.deprecated_function was '
214
 
            'deprecated in version 0.11.0.',
 
213
            'deprecated in version 0.11.',
215
214
            symbol_versioning.deprecation_string(
216
215
                symbol_versioning.deprecated_function,
217
216
                deprecated_in((0, 11, 0))))