/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_plugins.py

  • Committer: Jelmer Vernooij
  • Date: 2018-11-12 01:41:38 UTC
  • mto: (7143.16.20 even-more-cleanups)
  • mto: This revision was merged to the branch mainline in revision 7175.
  • Revision ID: jelmer@jelmer.uk-20181112014138-3b0zyx91cu3wdq3k
More PEP8 fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
import breezy
27
27
from .. import (
28
 
    errors,
29
28
    osutils,
30
29
    plugin,
31
30
    tests,
32
 
    trace,
33
31
    )
34
32
from ..sixish import (
35
 
    PY3,
36
33
    StringIO,
37
34
    viewkeys,
38
35
    )
576
573
    def test_get_help_text_with_additional_see_also(self):
577
574
        mod = FakeModule('two lines of help\nand more', 'demo')
578
575
        topic = plugin.ModuleHelpTopic(mod)
579
 
        self.assertEqual("two lines of help\nand more\n\n:See also: bar, foo\n",
580
 
                         topic.get_help_text(['foo', 'bar']))
 
576
        self.assertEqual(
 
577
            "two lines of help\nand more\n\n:See also: bar, foo\n",
 
578
            topic.get_help_text(['foo', 'bar']))
581
579
 
582
580
    def test_get_help_topic(self):
583
581
        """The help topic for a plugin is its module name."""
728
726
    def test_mixed(self):
729
727
        value = os.pathsep.join(['valid', 'in-valid'])
730
728
        self.assertEqual(['valid'], self._get_names(value))
731
 
        self.assertContainsRe(self.get_log(),
732
 
                              r"Invalid name 'in-valid' in BRZ_DISABLE_PLUGINS=" + repr(value))
 
729
        self.assertContainsRe(
 
730
            self.get_log(),
 
731
            r"Invalid name 'in-valid' in BRZ_DISABLE_PLUGINS=" + repr(value))
733
732
 
734
733
 
735
734
class TestEnvPluginsAt(tests.TestCase):
763
762
 
764
763
    def test_bad_name(self):
765
764
        self.assertEqual([], self._get_paths('/usr/local/bzr-git'))
766
 
        self.assertContainsRe(self.get_log(),
767
 
                              r"Invalid name 'bzr-git' in BRZ_PLUGINS_AT='/usr/local/bzr-git'")
 
765
        self.assertContainsRe(
 
766
            self.get_log(),
 
767
            r"Invalid name 'bzr-git' in BRZ_PLUGINS_AT='/usr/local/bzr-git'")
768
768
 
769
769
 
770
770
class TestLoadPluginAt(BaseTestPlugins):
826
826
        self.create_plugin_package('test_bar', dir='non-standard-dir/test_bar')
827
827
        self.overrideEnv('BRZ_PLUGINS_AT', 'test_foo@non-standard-dir')
828
828
        self.update_module_paths(['standard'])
829
 
        import breezy.testingplugins.test_foo
 
829
        import breezy.testingplugins.test_foo  # noqa: F401
830
830
        self.assertEqual(self.module_prefix + 'test_foo',
831
831
                         self.module.test_foo.__package__)
832
 
        import breezy.testingplugins.test_foo.test_bar
 
832
        import breezy.testingplugins.test_foo.test_bar  # noqa: F401
833
833
        self.assertIsSameRealPath('non-standard-dir/test_bar/__init__.py',
834
834
                                  self.module.test_foo.test_bar.__file__)
835
835
 
841
841
        self.create_plugin_package('test_bar', dir='another-dir/test_bar')
842
842
        self.overrideEnv('BRZ_PLUGINS_AT', 'test_foo@another-dir')
843
843
        self.update_module_paths(['standard'])
844
 
        import breezy.testingplugins.test_foo
 
844
        import breezy.testingplugins.test_foo  # noqa: F401
845
845
        self.assertEqual(self.module_prefix + 'test_foo',
846
846
                         self.module.test_foo.__package__)
847
847
        self.assertIsSameRealPath('another-dir/test_bar/__init__.py',