aboutsummaryrefslogtreecommitdiffstats
path: root/tests/option_tests.py
diff options
context:
space:
mode:
authorJesse Jaggars <jjaggars@redhat.com>2012-02-09 16:07:21 -0600
committerJesse Jaggars <jjaggars@redhat.com>2012-02-09 16:07:21 -0600
commitcf1319d29a012d9b72856464632a583d1b30c256 (patch)
tree3f889c6651062b7f860f8d8d576bf335d4a89cbc /tests/option_tests.py
parent48e56530dbe215976d5437b7ae7e07daf19a6f15 (diff)
downloadsos-cf1319d29a012d9b72856464632a583d1b30c256.tar.gz
Fixing a logic error with global option handlling
Diffstat (limited to 'tests/option_tests.py')
-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()