/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-06-08 23:30:31 UTC
  • mto: This revision was merged to the branch mainline in revision 6690.
  • Revision ID: jelmer@jelmer.uk-20170608233031-3qavls2o7a1pqllj
Update imports.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
import sys
20
20
 
21
21
from .. import (
22
 
    plugin as _mod_plugin,
23
22
    symbol_versioning,
24
23
    tests,
25
24
    )
97
96
            'a_feature',
98
97
            'UnicodeFilenameFeature',
99
98
            replacement_module='breezy.tests.features')
100
 
 
101
99
        def test_caller(message, category=None, stacklevel=1):
102
100
            # Find ourselves back from the right frame
103
101
            caller = sys._getframe(stacklevel)
130
128
        self.assertIs(None, feature.module)
131
129
 
132
130
 
133
 
class TestPluginLoadedFeature(tests.TestCase):
134
 
 
135
 
    def test_available_plugin(self):
136
 
        plugins = _mod_plugin.plugins()
137
 
        if not plugins:
138
 
            self.skipTest('no plugins available to test with')
139
 
        a_plugin_name = next(iter(plugins))
140
 
        feature = features.PluginLoadedFeature(a_plugin_name)
141
 
        self.assertEqual(a_plugin_name, feature.plugin_name)
142
 
        self.assertEqual(a_plugin_name + ' plugin', str(feature))
143
 
        self.assertTrue(feature.available())
144
 
 
145
 
    def test_unavailable_plugin(self):
146
 
        feature = features.PluginLoadedFeature('idontexist')
147
 
        self.assertEqual('idontexist plugin', str(feature))
148
 
        self.assertFalse(feature.available())
149
 
        self.assertIs(None, feature.plugin)
150
 
 
151
 
 
152
131
class TestUnicodeFilenameFeature(tests.TestCase):
153
132
 
154
133
    def test_probe_passes(self):
156
135
        # We can't test much more than that because the behaviour depends
157
136
        # on the platform.
158
137
        features.UnicodeFilenameFeature._probe()
159
 
 
160
 
 
161
 
class TestBackslashFilenameFeature(tests.TestCase):
162
 
 
163
 
    def test_probe_passes(self):
164
 
        """BackslashFilenameFeature._probe passes."""
165
 
        # We can't test much more than that because the behaviour depends
166
 
        # on the platform.
167
 
        features.BackslashFilenameFeature._probe()