/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/test_features.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-21 18:10:28 UTC
  • mto: This revision was merged to the branch mainline in revision 6623.
  • Revision ID: jelmer@jelmer.uk-20170521181028-zn04pdfw0od9hfj3
Rename brzlib => breezy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
import sys
20
20
 
21
 
from brzlib import (
 
21
from breezy import (
22
22
    symbol_versioning,
23
23
    tests,
24
24
    )
25
 
from brzlib.tests import (
 
25
from breezy.tests import (
26
26
    features,
27
27
    )
28
28
 
73
73
# it's really just a test fixture for test-feature deprecation.
74
74
simple_thunk_feature = features._CompatabilityThunkFeature(
75
75
    symbol_versioning.deprecated_in((2, 1, 0)),
76
 
    'brzlib.tests.test_features',
 
76
    'breezy.tests.test_features',
77
77
    'simple_thunk_feature',
78
78
    'UnicodeFilenameFeature',
79
 
    replacement_module='brzlib.tests.features')
 
79
    replacement_module='breezy.tests.features')
80
80
 
81
81
 
82
82
class Test_CompatibilityFeature(tests.TestCase):
83
83
 
84
84
    def test_does_thunk(self):
85
85
        res = self.callDeprecated(
86
 
            ['brzlib.tests.test_features.simple_thunk_feature '
 
86
            ['breezy.tests.test_features.simple_thunk_feature '
87
87
             'was deprecated in version 2.1.0. '
88
 
             'Use brzlib.tests.features.UnicodeFilenameFeature instead.'],
 
88
             'Use breezy.tests.features.UnicodeFilenameFeature instead.'],
89
89
            simple_thunk_feature.available)
90
90
        self.assertEqual(features.UnicodeFilenameFeature.available(), res)
91
91
 
92
92
    def test_reports_correct_location(self):
93
93
        a_feature = features._CompatabilityThunkFeature(
94
94
            symbol_versioning.deprecated_in((2, 1, 0)),
95
 
            'brzlib.tests.test_features',
 
95
            'breezy.tests.test_features',
96
96
            'a_feature',
97
97
            'UnicodeFilenameFeature',
98
 
            replacement_module='brzlib.tests.features')
 
98
            replacement_module='breezy.tests.features')
99
99
        def test_caller(message, category=None, stacklevel=1):
100
100
            # Find ourselves back from the right frame
101
101
            caller = sys._getframe(stacklevel)
114
114
class TestModuleAvailableFeature(tests.TestCase):
115
115
 
116
116
    def test_available_module(self):
117
 
        feature = features.ModuleAvailableFeature('brzlib.tests')
118
 
        self.assertEqual('brzlib.tests', feature.module_name)
119
 
        self.assertEqual('brzlib.tests', str(feature))
 
117
        feature = features.ModuleAvailableFeature('breezy.tests')
 
118
        self.assertEqual('breezy.tests', feature.module_name)
 
119
        self.assertEqual('breezy.tests', str(feature))
120
120
        self.assertTrue(feature.available())
121
121
        self.assertIs(tests, feature.module)
122
122
 
123
123
    def test_unavailable_module(self):
124
124
        feature = features.ModuleAvailableFeature(
125
 
            'brzlib.no_such_module_exists')
126
 
        self.assertEqual('brzlib.no_such_module_exists', str(feature))
 
125
            'breezy.no_such_module_exists')
 
126
        self.assertEqual('breezy.no_such_module_exists', str(feature))
127
127
        self.assertFalse(feature.available())
128
128
        self.assertIs(None, feature.module)
129
129