~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_plugins.py

  • Committer: Tarmac
  • Author(s): Vincent Ladeuil
  • Date: 2017-01-30 14:42:05 UTC
  • mfrom: (6620.1.1 trunk)
  • Revision ID: tarmac-20170130144205-r8fh2xpmiuxyozpv
Merge  2.7 into trunk including fix for bug #1657238 [r=vila]

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2011 Canonical Ltd
 
1
# Copyright (C) 2005-2012, 2016 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
284
284
        log = self.load_and_capture(name)
285
285
        self.assertNotContainsRe(log,
286
286
            r"It requested API version")
287
 
        self.assertEquals(
 
287
        self.assertEqual(
288
288
            ['wants100'],
289
289
            plugin.plugin_warnings.keys())
290
290
        self.assertContainsRe(
309
309
        # check the plugin is not loaded already
310
310
        self.assertPluginUnknown('plugin')
311
311
        # write a plugin that _cannot_ fail to load.
312
 
        file('plugin.py', 'w').write(source + '\n')
 
312
        with file('plugin.py', 'w') as f: f.write(source + '\n')
313
313
        self.addCleanup(self.teardown_plugin)
314
314
        plugin.load_from_path(['.'])
315
315
 
709
709
        if setting_dirs:
710
710
            self._set_path(*setting_dirs)
711
711
        actual = plugin.get_standard_plugins_path()
712
 
        self.assertEquals(self._list2paths(*expected_dirs), actual)
 
712
        self.assertEqual(self._list2paths(*expected_dirs), actual)
713
713
 
714
714
    def test_default(self):
715
715
        self.check_path([self.user, self.core, self.site],
827
827
        return plugin._get_specific_plugin_paths(paths)
828
828
 
829
829
    def test_empty(self):
830
 
        self.assertEquals([], self._get_paths(None))
831
 
        self.assertEquals([], self._get_paths(''))
 
830
        self.assertEqual([], self._get_paths(None))
 
831
        self.assertEqual([], self._get_paths(''))
832
832
 
833
833
    def test_one_path(self):
834
 
        self.assertEquals([('b', 'man')], self._get_paths('b@man'))
 
834
        self.assertEqual([('b', 'man')], self._get_paths('b@man'))
835
835
 
836
836
    def test_bogus_path(self):
837
837
        # We need a '@'
975
975
        self.overrideAttr(plugin, 'plugin_warnings',
976
976
            {'bad': ['Failed to load (just testing)']})
977
977
        self.overrideAttr(plugin, 'plugins', dummy_plugins)
978
 
        self.assertEquals("""\
 
978
        self.assertEqual("""\
979
979
bad (failed to load)
980
980
  ** Failed to load (just testing)
981
981