diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2014-09-12 18:21:32 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2014-09-12 18:26:16 +0100 |
commit | 1e99d4a8a7edbd9870d5171849befa58082d4705 (patch) | |
tree | a36e7e905b3ca327d7a55764e9dd29dc3f6ba02f /tests/plugin_tests.py | |
parent | 256a09c083073f783eae2149c178cf45448ea38d (diff) | |
download | sos-1e99d4a8a7edbd9870d5171849befa58082d4705.tar.gz |
[plugin] mark more interfaces private
Numerous Plugin methods are not expected to be called from outside
the base class. Mark them private with a leading underscore:
_copy_dir()
_copy_node()
_copy_symlink()
_do_copy_path()
_expand_copy_spec()
_mangle_command()
_make_command_filename()
_is_forbidden_path()
_collect_copy_specs()
_collect_cmd_output()
_collect_strings()
A couple of these (_mangle_command() and _do_copy_path()) are
invoked from the Plugin test suite; update the relevant cases to
call the new names.
Fixes #348.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
Diffstat (limited to 'tests/plugin_tests.py')
-rw-r--r-- | tests/plugin_tests.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/plugin_tests.py b/tests/plugin_tests.py index c44c1629..956f808d 100644 --- a/tests/plugin_tests.py +++ b/tests/plugin_tests.py @@ -9,7 +9,7 @@ try: except: from io import StringIO -from sos.plugins import Plugin, regex_findall, mangle_command +from sos.plugins import Plugin, regex_findall, _mangle_command from sos.archive import TarFileArchive, ZipFileArchive import sos.policies @@ -115,12 +115,12 @@ class PluginToolTests(unittest.TestCase): self.assertEquals(matches, []) def test_mangle_command(self): - self.assertEquals("foo", mangle_command("/usr/bin/foo")) - self.assertEquals("foo_-x", mangle_command("/usr/bin/foo -x")) - self.assertEquals("foo_--verbose", mangle_command("/usr/bin/foo --verbose")) - self.assertEquals("foo_.path.to.stuff", mangle_command("/usr/bin/foo /path/to/stuff")) + self.assertEquals("foo", _mangle_command("/usr/bin/foo")) + self.assertEquals("foo_-x", _mangle_command("/usr/bin/foo -x")) + self.assertEquals("foo_--verbose", _mangle_command("/usr/bin/foo --verbose")) + self.assertEquals("foo_.path.to.stuff", _mangle_command("/usr/bin/foo /path/to/stuff")) expected = "foo_.path.to.stuff.this.is.very.long.and.i.only.expect.part.of.it.maybe.this.is.enough.i.hope.so"[0:64] - self.assertEquals(expected, mangle_command("/usr/bin/foo /path/to/stuff/this/is/very/long/and/i/only/expect/part/of/it/maybe/this/is/enough/i/hope/so")) + self.assertEquals(expected, _mangle_command("/usr/bin/foo /path/to/stuff/this/is/very/long/and/i/only/expect/part/of/it/maybe/this/is/enough/i/hope/so")) class PluginTests(unittest.TestCase): @@ -194,11 +194,11 @@ class PluginTests(unittest.TestCase): self.assertEquals(p.get_option_as_list("opt"), ['testing']) def test_copy_dir(self): - self.mp.do_copy_path("tests") + self.mp._do_copy_path("tests") self.assertEquals(self.mp.archive.m["tests/plugin_tests.py"], 'tests/plugin_tests.py') def test_copy_dir_bad_path(self): - self.mp.do_copy_path("not_here_tests") + self.mp._do_copy_path("not_here_tests") self.assertEquals(self.mp.archive.m, {}) def test_copy_dir_forbidden_path(self): @@ -207,7 +207,7 @@ class PluginTests(unittest.TestCase): }) p.archive = MockArchive() p.setup() - p.do_copy_path("tests") + p._do_copy_path("tests") self.assertEquals(p.archive.m, {}) |