test help function

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-09-28 09:15:04 +02:00
parent 5d018393a9
commit 3265755bb9

View file

@ -34,6 +34,8 @@ sys.path.insert(0, os.path.abspath(
cdist_exec_path = os.path.abspath(
os.path.join(os.path.dirname(os.path.realpath(__file__)), "bin/cdist"))
cdist_commands=["banner", "config", "install"]
import cdist
import cdist.config
import cdist.exec
@ -155,6 +157,10 @@ class UI(unittest.TestCase):
def test_banner(self):
self.assertEqual(subprocess.call([cdist_exec_path, "banner"]), 0)
def test_help(self):
for cmd in cdist_commands:
self.assertEqual(subprocess.call([cdist_exec_path, cmd, "-h"]), 0)
if __name__ == '__main__':
unittest.main()