~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_features.py

  • Committer: Patch Queue Manager
  • Date: 2011-10-14 16:54:26 UTC
  • mfrom: (6216.1.1 remove-this-file)
  • Revision ID: pqm@pqm.ubuntu.com-20111014165426-tjix4e6idryf1r2z
(jelmer) Remove an accidentally committed .THIS file. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
"""Tests for test feature dependencies."""
18
 
 
19
 
import sys
 
17
"""Tests for test feature dependencies.
 
18
"""
20
19
 
21
20
from bzrlib import (
22
21
    symbol_versioning,
89
88
            simple_thunk_feature.available)
90
89
        self.assertEqual(features.UnicodeFilenameFeature.available(), res)
91
90
 
92
 
    def test_reports_correct_location(self):
93
 
        a_feature = features._CompatabilityThunkFeature(
94
 
            symbol_versioning.deprecated_in((2, 1, 0)),
95
 
            'bzrlib.tests.test_features',
96
 
            'a_feature',
97
 
            'UnicodeFilenameFeature',
98
 
            replacement_module='bzrlib.tests.features')
99
 
        def test_caller(message, category=None, stacklevel=1):
100
 
            # Find ourselves back from the right frame
101
 
            caller = sys._getframe(stacklevel)
102
 
            reported_file = caller.f_globals['__file__']
103
 
            reported_lineno = caller.f_lineno
104
 
            self.assertEquals(__file__, reported_file)
105
 
            # The call we're tracking occurred the line after we grabbed the
106
 
            # lineno.
107
 
            self.assertEquals(self.lineno + 1, reported_lineno)
108
 
        self.overrideAttr(symbol_versioning, 'warn', test_caller)
109
 
        # Grab the current lineno
110
 
        self.lineno = sys._getframe().f_lineno
111
 
        self.requireFeature(a_feature)
112
 
 
113
91
 
114
92
class TestModuleAvailableFeature(tests.TestCase):
115
93