aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sos/plugins/__init__.py2
-rw-r--r--tests/plugin_tests.py3
2 files changed, 5 insertions, 0 deletions
diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py
index 7b6180c6..7e865cdf 100644
--- a/sos/plugins/__init__.py
+++ b/sos/plugins/__init__.py
@@ -394,6 +394,8 @@ class Plugin(object):
self.name(), strfile), _file)
def add_copy_specs(self, copyspecs):
+ if isinstance(copyspecs, six.string_types):
+ raise TypeError("Plugin.add_copy_specs called with string argument")
for copyspec in copyspecs:
self.add_copy_spec(copyspec)
diff --git a/tests/plugin_tests.py b/tests/plugin_tests.py
index a4905cf9..c44c1629 100644
--- a/tests/plugin_tests.py
+++ b/tests/plugin_tests.py
@@ -243,6 +243,9 @@ class AddCopySpecTests(unittest.TestCase):
self.mp.add_copy_specs(["tests/tail_test.txt"])
self.assert_expect_paths()
+ def test_add_copy_spec_nostrings(self):
+ self.assertRaises(TypeError, self.mp.add_copy_specs,"stringsarebadmkay?")
+
# add_copy_spec_limit()
def test_single_file_over_limit(self):