~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_symbol_versioning.py

Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# Copyright (C) 2006, 2007 Canonical Ltd
2
2
#   Authors: Robert Collins <robert.collins@canonical.com>
 
3
#   and others
3
4
#
4
5
# This program is free software; you can redistribute it and/or modify
5
6
# it under the terms of the GNU General Public License as published by
56
57
        """
57
58
        return 1
58
59
 
 
60
    @staticmethod
 
61
    @symbol_versioning.deprecated_function(symbol_versioning.zero_seven)
 
62
    def deprecated_static():
 
63
        """Deprecated static."""
 
64
        return 1
 
65
 
 
66
    def test_deprecated_static(self):
 
67
        # XXX: The results are not quite right because the class name is not
 
68
        # shown - however it is enough to give people a good indication of
 
69
        # where the problem is.
 
70
        expected_warning = (
 
71
            "bzrlib.tests.test_symbol_versioning."
 
72
            "deprecated_static "
 
73
            "was deprecated in version 0.7.", DeprecationWarning, 2)
 
74
        expected_docstring = (
 
75
            'Deprecated static.\n'
 
76
            '\n'
 
77
            'This function was deprecated in version 0.7.\n'
 
78
            )
 
79
        self.check_deprecated_callable(
 
80
            expected_warning, expected_docstring,
 
81
            "deprecated_static",
 
82
            "bzrlib.tests.test_symbol_versioning",
 
83
            self.deprecated_static)
 
84
 
59
85
    def test_deprecated_method(self):
60
86
        expected_warning = (
61
87
            "bzrlib.tests.test_symbol_versioning."