summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2014-09-01 14:46:18 +0200
committerJan Pokorný <jpokorny@redhat.com>2014-09-01 14:49:08 +0200
commit6985299c8cd3fd0e57a2ba77e66755bb838faafa (patch)
tree67eeae723c23947fdda028d7df2e9df79fe5db72 /tests
parent7175d05335dbed0dde0e06d5de19954b6ca47042 (diff)
downloadclufter-6985299c8cd3fd0e57a2ba77e66755bb838faafa.tar.gz
clufter-6985299c8cd3fd0e57a2ba77e66755bb838faafa.tar.xz
clufter-6985299c8cd3fd0e57a2ba77e66755bb838faafa.zip
command: make usable as a library (output as a string, etc.)
New unit test included. Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/run_cmd.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/run_cmd.py b/tests/run_cmd.py
index 0d5e1ff..2eb2db3 100644
--- a/tests/run_cmd.py
+++ b/tests/run_cmd.py
@@ -40,6 +40,24 @@ class Main(unittest.TestCase):
# just the existence of the files is enough for now...
map(lambda f: self.assertTrue(exists(f)), files.itervalues())
+ def testCcs2PcsNeedleBetter(self):
+ testfile = join(dirname(__file__), 'filled.conf')
+
+ files = {
+ "cib": {'passin': 'bytestring', },
+ "coro": {'passin': 'bytestring', },
+ }
+ clufter_args = type("cluster_args", (object, ), dict(
+ input=testfile,
+ nocheck=True,
+ batch=True,
+ **files)
+ )
+ cmd_manager = CommandManager.implicit()
+ self.assertFalse(cmd_manager.commands["ccs2pcs-needle"](clufter_args))
+ # just the existence of non-null strings is enough for now...
+ map(lambda fspec: self.assertTrue(fspec['passout']), files.values())
+
if __name__ == '__main__':
unittest.main()