/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to breezy/tests/test_features.py

Merge trunk, address review comments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
import sys
20
20
 
 
21
import breezy
21
22
from .. import (
22
23
    symbol_versioning,
23
24
    tests,
128
129
        self.assertIs(None, feature.module)
129
130
 
130
131
 
 
132
class TestPluginLoadedFeature(tests.TestCase):
 
133
 
 
134
    def test_available_plugin(self):
 
135
        if not breezy.global_state.plugins:
 
136
            self.skipTest('no plugins available to test with')
 
137
        a_plugin_name = next(iter(breezy.global_state.plugins))
 
138
        feature = features.PluginLoadedFeature(a_plugin_name)
 
139
        self.assertEqual(a_plugin_name, feature.plugin_name)
 
140
        self.assertEqual(a_plugin_name + ' plugin', str(feature))
 
141
        self.assertTrue(feature.available())
 
142
 
 
143
    def test_unavailable_plugin(self):
 
144
        feature = features.PluginLoadedFeature('idontexist')
 
145
        self.assertEqual('idontexist plugin', str(feature))
 
146
        self.assertFalse(feature.available())
 
147
        self.assertIs(None, feature.plugin)
 
148
 
 
149
 
131
150
class TestUnicodeFilenameFeature(tests.TestCase):
132
151
 
133
152
    def test_probe_passes(self):