forked from ungleich-public/cdist
add test for Explorer run_global_explorers
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
parent
97ab6effa4
commit
6f82aef704
2 changed files with 9 additions and 1 deletions
|
@ -62,7 +62,7 @@ class ExplorerClassTestCase(test.CdistTestCase):
|
||||||
shutil.rmtree(self.remote_base_path)
|
shutil.rmtree(self.remote_base_path)
|
||||||
|
|
||||||
def test_list_global_explorer_names(self):
|
def test_list_global_explorer_names(self):
|
||||||
expected = ['global']
|
expected = ['foobar', 'global']
|
||||||
self.assertEqual(self.explorer.list_global_explorer_names(), expected)
|
self.assertEqual(self.explorer.list_global_explorer_names(), expected)
|
||||||
|
|
||||||
def test_transfer_global_explorers(self):
|
def test_transfer_global_explorers(self):
|
||||||
|
@ -76,6 +76,12 @@ class ExplorerClassTestCase(test.CdistTestCase):
|
||||||
output = self.explorer.run_global_explorer('global')
|
output = self.explorer.run_global_explorer('global')
|
||||||
self.assertEqual(output, 'global\n')
|
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):
|
def test_list_type_explorer_names(self):
|
||||||
cdist_type = core.Type(self.local.type_path, '__test_type')
|
cdist_type = core.Type(self.local.type_path, '__test_type')
|
||||||
expected = cdist_type.explorers
|
expected = cdist_type.explorers
|
||||||
|
|
2
lib/cdist/test/explorer/fixtures/conf/explorer/foobar
Executable file
2
lib/cdist/test/explorer/fixtures/conf/explorer/foobar
Executable file
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/sh
|
||||||
|
echo foobar
|
Loading…
Reference in a new issue