From 6f82aef7048fa33c25130970147af312de55caff Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Thu, 20 Oct 2011 10:55:11 +0200 Subject: [PATCH] add test for Explorer run_global_explorers Signed-off-by: Steven Armstrong --- lib/cdist/test/explorer/__init__.py | 8 +++++++- lib/cdist/test/explorer/fixtures/conf/explorer/foobar | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100755 lib/cdist/test/explorer/fixtures/conf/explorer/foobar diff --git a/lib/cdist/test/explorer/__init__.py b/lib/cdist/test/explorer/__init__.py index 18815f07..6743ee26 100644 --- a/lib/cdist/test/explorer/__init__.py +++ b/lib/cdist/test/explorer/__init__.py @@ -62,7 +62,7 @@ class ExplorerClassTestCase(test.CdistTestCase): shutil.rmtree(self.remote_base_path) def test_list_global_explorer_names(self): - expected = ['global'] + expected = ['foobar', 'global'] self.assertEqual(self.explorer.list_global_explorer_names(), expected) def test_transfer_global_explorers(self): @@ -76,6 +76,12 @@ class ExplorerClassTestCase(test.CdistTestCase): output = self.explorer.run_global_explorer('global') self.assertEqual(output, 'global\n') + def test_run_global_explorers(self): + out_path = self.mkdtemp() + self.explorer.run_global_explorers(out_path) + self.assertEqual(os.listdir(out_path), ['foobar', 'global']) + shutil.rmtree(out_path) + def test_list_type_explorer_names(self): cdist_type = core.Type(self.local.type_path, '__test_type') expected = cdist_type.explorers diff --git a/lib/cdist/test/explorer/fixtures/conf/explorer/foobar b/lib/cdist/test/explorer/fixtures/conf/explorer/foobar new file mode 100755 index 00000000..33533edd --- /dev/null +++ b/lib/cdist/test/explorer/fixtures/conf/explorer/foobar @@ -0,0 +1,2 @@ +#!/bin/sh +echo foobar