aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/option_tests.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/option_tests.py b/tests/option_tests.py
new file mode 100644
index 00000000..06f048a4
--- /dev/null
+++ b/tests/option_tests.py
@@ -0,0 +1,24 @@
+#!/usr/bin/env python
+
+import unittest
+
+from sos.plugins import Plugin
+
+class GlobalOptionTest(unittest.TestCase):
+
+ def setUp(self):
+ self.commons = {
+ 'global_plugin_options': {
+ 'test_option': 'foobar',
+ },
+ }
+ self.plugin = Plugin(self.commons)
+
+ def test_simple_lookup(self):
+ self.assertEquals(self.plugin.getOption('test_option'), 'foobar')
+
+ def test_multi_lookup(self):
+ self.assertEquals(self.plugin.getOption(('not_there', 'test_option')), 'foobar')
+
+if __name__ == "__main__":
+ unittest.main()