diff options
Diffstat (limited to 'tests/plugin_tests.py')
-rw-r--r-- | tests/plugin_tests.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/plugin_tests.py b/tests/plugin_tests.py index 87940b8e..a3055543 100644 --- a/tests/plugin_tests.py +++ b/tests/plugin_tests.py @@ -3,7 +3,7 @@ import os import tempfile from StringIO import StringIO -from sos.plugins import Plugin, regex_findall, sosRelPath +from sos.plugins import Plugin, regex_findall, sosRelPath, mangle_command from sos.utilities import Archive PATH = os.path.dirname(__file__) @@ -126,6 +126,14 @@ class PluginToolTests(unittest.TestCase): path2 = "foo/lib/boo" self.assertEquals(sosRelPath(path1, path2), "foo/lib/boo") + 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")) + 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")) + class PluginTests(unittest.TestCase): |