aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJesse Jaggars <jjaggars@redhat.com>2012-03-14 19:09:06 -0500
committerJesse Jaggars <jjaggars@redhat.com>2012-03-14 19:09:06 -0500
commit44ddbc54cffe2d1adb51ed805901a9124ca71f01 (patch)
tree15709d688edb21f55b101d5040f40de6a8ba22bf /tests
parent20e9d49b29a63614ee173d7773113aa610252936 (diff)
downloadsos-44ddbc54cffe2d1adb51ed805901a9124ca71f01.tar.gz
fixing some python2.5 compatibility issues
Diffstat (limited to 'tests')
-rw-r--r--tests/plugin_tests.py10
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):