From 13ed37a4e954d60e27199bfc981d7b795fb36302 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 4 Oct 2011 14:45:35 +0200 Subject: [PATCH] begin to test explorer success in test_install Signed-off-by: Nico Schottelius --- build.sh | 8 +++++--- lib/cdist/test/test_install.py | 12 ++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index 39192c78..01094e12 100755 --- a/build.sh +++ b/build.sh @@ -41,9 +41,6 @@ MAN1DSTDIR=${MANDIR}/man1 MAN7DSTDIR=${MANDIR}/man7 SPEECHESDIR=doc/speeches -# FIXME: make lib for tests! -# PYTHONPATH=$PYTHONPATH:$(pwd -P)/test/lib - case "$1" in man) set -e @@ -133,6 +130,11 @@ case "$1" in python3 -m unittest discover lib/cdist/test 'test_*.py' ;; + test-install) + PYTHONPATH=$PYTHONPATH:$(pwd -P)/lib \ + python3 -m unittest cdist.test.test_install + ;; + test-all) python3 -m unittest discover lib/cdist/test '*.py' ;; diff --git a/lib/cdist/test/test_install.py b/lib/cdist/test/test_install.py index 21e8ca06..f5956585 100644 --- a/lib/cdist/test/test_install.py +++ b/lib/cdist/test/test_install.py @@ -43,6 +43,18 @@ class Install(unittest.TestCase): exec_path=cdist_exec_path) self.config.link_emulator() +### NEW FOR INSTALL ############################################################ + + def test_explorer_ran(self): + """Check that all explorers returned a result""" + self.config.run_global_explores() + explorers = self.config.path.list_global_explorers() + + for explorer in explorers: + output = self.path.global_explorer_output_path(explorer) + self.assertTrue(os.path.isfile(output)) + +### OLD FROM CONFIG ############################################################ def test_initial_manifest_different_parameter(self): manifest_fd = open(self.init_manifest, "w") manifest_fd.writelines(["#!/bin/sh\n",