/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-07-23 22:06:41 UTC
  • mfrom: (6738 trunk)
  • mto: This revision was merged to the branch mainline in revision 6739.
  • Revision ID: jelmer@jelmer.uk-20170723220641-69eczax9bmv8d6kk
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):